Skip to content

Commit 5942c08

Browse files
committed
Added IMGUI_VERSION_NUM for easy compile-time testing. (#2025)
1 parent f23d29b commit 5942c08

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.txt

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Other Changes:
6060
- Drag and Drop: Added ImGuiDragDropFlags_SourceAutoExpirePayload flag to force payload to expire if the source stops being submitted. (#1725, #143).
6161
- IsItemHovered(): Added ImGuiHoveredFlags_AllowWhenDisabled flag to query hovered status on disabled items. (#1940, #211)
6262
- Selectable: Added ImGuiSelectableFlags_Disabled flag in the public API. (#211)
63+
- Misc: Added IMGUI_VERSION_NUM for easy compile-time testing. (#2025)
6364
- Misc: Added ImGuiMouseCursor_Hand cursor enum + corresponding software cursor. (#1913, 1914) [@aiekick, @ocornut]
6465
- Misc: Tweaked software mouse cursor offset to match the offset of the corresponding Windows 10 cursors.
6566
- Made assertion more clear when trying to call Begin() outside of the NewFrame()..EndFrame() scope. (#1987)

imgui.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2902,7 +2902,7 @@ void ImGui::SetCurrentContext(ImGuiContext* ctx)
29022902
bool ImGui::DebugCheckVersionAndDataLayout(const char* version, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_vert)
29032903
{
29042904
bool error = false;
2905-
if (strcmp(version, IMGUI_VERSION)!=0) { error = true; IM_ASSERT(strcmp(version,IMGUI_VERSION)==0 && "Mismatch version string!"); }
2905+
if (strcmp(version, IMGUI_VERSION)!=0) { error = true; IM_ASSERT(strcmp(version,IMGUI_VERSION)==0 && "Mismatched version string!"); }
29062906
if (sz_io != sizeof(ImGuiIO)) { error = true; IM_ASSERT(sz_io == sizeof(ImGuiIO) && "Mismatched struct layout!"); }
29072907
if (sz_style != sizeof(ImGuiStyle)) { error = true; IM_ASSERT(sz_style == sizeof(ImGuiStyle) && "Mismatched struct layout!"); }
29082908
if (sz_vec2 != sizeof(ImVec2)) { error = true; IM_ASSERT(sz_vec2 == sizeof(ImVec2) && "Mismatched struct layout!"); }

imgui.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
#include <string.h> // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp
2323

2424
// Version
25+
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY00 then bounced up to XYY01 when release tagging happens)
2526
#define IMGUI_VERSION "1.63 WIP"
27+
#define IMGUI_VERSION_NUM 16300
2628
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert))
2729

2830
// Define attributes of all API symbols declarations (e.g. for DLL under Windows)
@@ -179,7 +181,7 @@ namespace ImGui
179181
IMGUI_API bool ShowStyleSelector(const char* label); // add style selector block (not a window), essentially a combo listing the default styles.
180182
IMGUI_API void ShowFontSelector(const char* label); // add font selector block (not a window), essentially a combo listing the loaded fonts.
181183
IMGUI_API void ShowUserGuide(); // add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls).
182-
IMGUI_API const char* GetVersion(); // get a version string e.g. "1.23"
184+
IMGUI_API const char* GetVersion(); // get the compiled version string e.g. "1.23"
183185

184186
// Styles
185187
IMGUI_API void StyleColorsDark(ImGuiStyle* dst = NULL); // new, recommended style (default)

0 commit comments

Comments
 (0)