From 0d6a84344c15533999e6647629f9121a67375fae Mon Sep 17 00:00:00 2001 From: sonoro1234 Date: Thu, 6 Nov 2025 19:11:44 +0100 Subject: [PATCH] add define ImTextureID_Invalid --- cimgui.h | 2 ++ generator/generator.lua | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cimgui.h b/cimgui.h index 02807fe..464a59e 100644 --- a/cimgui.h +++ b/cimgui.h @@ -3810,6 +3810,8 @@ typedef enum { #define ImDrawCallback_ResetRenderState (ImDrawCallback)(-8) +#define ImTextureID_Invalid ((ImTextureID)0) + #else struct GLFWwindow; struct SDL_Window; diff --git a/generator/generator.lua b/generator/generator.lua index 4ef2119..b1ea0f0 100644 --- a/generator/generator.lua +++ b/generator/generator.lua @@ -294,6 +294,9 @@ local function cimgui_generation(parser) if gdefines.ImDrawCallback_ResetRenderState then cstructsstr = cstructsstr.."\n#define ImDrawCallback_ResetRenderState "..gdefines.ImDrawCallback_ResetRenderState.."\n" end + if gdefines.ImTextureID_Invalid then + cstructsstr = cstructsstr.."\n#define ImTextureID_Invalid "..gdefines.ImTextureID_Invalid.."\n" + end if gdefines.IMGUI_HAS_IMSTR then if not (NOCHAR or NOIMSTRV) then cstructsstr = cstructsstr.."\n#define IMGUI_HAS_IMSTR 1\n" @@ -332,7 +335,7 @@ end -------------------------------------------------------- --get imgui.h version and IMGUI_HAS_DOCK-------------------------- --defines for the cl compiler must be present in the print_defines.cpp file -gdefines = get_defines{"IMGUI_VERSION","IMGUI_VERSION_NUM","FLT_MAX","FLT_MIN","IMGUI_HAS_DOCK","IMGUI_HAS_IMSTR","ImDrawCallback_ResetRenderState","IMGUI_HAS_TEXTURES"} +gdefines = get_defines{"IMGUI_VERSION","IMGUI_VERSION_NUM","FLT_MAX","FLT_MIN","IMGUI_HAS_DOCK","IMGUI_HAS_IMSTR","ImDrawCallback_ResetRenderState","IMGUI_HAS_TEXTURES","ImTextureID_Invalid"} cpp2ffi.prtable(gdefines) if gdefines.IMGUI_HAS_DOCK then gdefines.IMGUI_HAS_DOCK = true end if gdefines.IMGUI_HAS_IMSTR then gdefines.IMGUI_HAS_IMSTR = true end