Skip to content

Commit

Permalink
Merge branch 'DctrNoob-simgui-textureid-update'
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Oct 22, 2024
2 parents 4bda146 + 0b3f33a commit bcd2cf6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
## Updates

### 22-Oct-2024

- sokol_imgui.h: Fixed for latest Dear ImGui version 1.91.4 (Dear ImGui has
changed the ImTextureID handle from `void*` to `uint64_t` which requires some
minor fixes, also in the public API (so technically it's a breaking change
but it's unlikely that most code will be affected).

Many thanks to @DctrNoob for the PR (https://github.com/floooh/sokol/pull/1134).

Also related change if you're using fips: the following ImGui wrapper repos
have been updated to 1.91.4:

- https://github.com/fips-libs/fips-imgui
- https://github.com/fips-libs/fips-cimgui
- https://github.com/fips-libs/fips-imgui-dock

### 14-Oct-2024

- sokol_gfx.h: The pixel format RG11B10F is now marked as renderable in the GL
Expand Down
12 changes: 6 additions & 6 deletions util/sokol_imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ SOKOL_IMGUI_API_DECL void simgui_render(void);
SOKOL_IMGUI_API_DECL simgui_image_t simgui_make_image(const simgui_image_desc_t* desc);
SOKOL_IMGUI_API_DECL void simgui_destroy_image(simgui_image_t img);
SOKOL_IMGUI_API_DECL simgui_image_desc_t simgui_query_image_desc(simgui_image_t img);
SOKOL_IMGUI_API_DECL void* simgui_imtextureid(simgui_image_t img);
SOKOL_IMGUI_API_DECL simgui_image_t simgui_image_from_imtextureid(void* im_texture_id);
SOKOL_IMGUI_API_DECL uint64_t simgui_imtextureid(simgui_image_t img);
SOKOL_IMGUI_API_DECL simgui_image_t simgui_image_from_imtextureid(uint64_t im_texture_id);
SOKOL_IMGUI_API_DECL void simgui_add_focus_event(bool focus);
SOKOL_IMGUI_API_DECL void simgui_add_mouse_pos_event(float x, float y);
SOKOL_IMGUI_API_DECL void simgui_add_touch_pos_event(float x, float y);
Expand Down Expand Up @@ -2505,14 +2505,14 @@ SOKOL_API_IMPL simgui_image_desc_t simgui_query_image_desc(simgui_image_t img_id
return desc;
}

SOKOL_API_IMPL void* simgui_imtextureid(simgui_image_t img) {
SOKOL_API_IMPL uint64_t simgui_imtextureid(simgui_image_t img) {
SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
return (void*)(uintptr_t)img.id;
return (uint64_t)(uintptr_t)img.id;
}

SOKOL_API_IMPL simgui_image_t simgui_image_from_imtextureid(void* im_texture_id) {
SOKOL_API_IMPL simgui_image_t simgui_image_from_imtextureid(uint64_t im_texture_id) {
SOKOL_ASSERT(_SIMGUI_INIT_COOKIE == _simgui.init_cookie);
simgui_image_t img = { (uint32_t)(uintptr_t) im_texture_id };
simgui_image_t img = { (uint32_t)im_texture_id };
return img;
}

Expand Down

0 comments on commit bcd2cf6

Please sign in to comment.