From 33185e4ee78aaab751c1e4146832866caaf12021 Mon Sep 17 00:00:00 2001 From: Thomas Stehle Date: Mon, 21 Oct 2024 20:20:01 +0200 Subject: [PATCH 1/2] sokol_imgui.h: changed ImTextureID type from void* to uint64_t --- util/sokol_imgui.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/util/sokol_imgui.h b/util/sokol_imgui.h index 3e76353a4..f8f1a7ba7 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; } From 0b3f33a9c445fddd20911faacf3ce4b4e8d87543 Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Tue, 22 Oct 2024 18:56:39 +0200 Subject: [PATCH 2/2] update changelog (https://github.com/floooh/sokol/pull/1134) --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cd539577..f3694304e 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