aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2024-10-22 18:57:04 +0200
committerAndre Weissflog <floooh@gmail.com>2024-10-22 18:57:04 +0200
commitbcd2cf68857613dc698e13fdc26e80232a1f6979 (patch)
tree54ee07f1dadb0643766cada8feff926fe3876b39
parent4bda1469d3b311af03a34dd956460776c920dc2e (diff)
parent0b3f33a9c445fddd20911faacf3ce4b4e8d87543 (diff)
Merge branch 'DctrNoob-simgui-textureid-update'
-rw-r--r--CHANGELOG.md16
-rw-r--r--util/sokol_imgui.h12
2 files changed, 22 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8cd53957..f3694304 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/util/sokol_imgui.h b/util/sokol_imgui.h
index 3e76353a..f8f1a7ba 100644
--- a/util/sokol_imgui.h
+++ b/util/sokol_imgui.h
@@ -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);
@@ -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;
}