Encode version string in binary to facilitate identification when demo/tools are striped + amend About window.

This commit is contained in:
ocornut 2023-06-14 16:13:01 +02:00
parent 534340cd88
commit 6cabad6e7a
3 changed files with 6 additions and 1 deletions

View File

@ -3512,6 +3512,7 @@ void ImGui::DestroyContext(ImGuiContext* ctx)
// IMPORTANT: ###xxx suffixes must be same in ALL languages // IMPORTANT: ###xxx suffixes must be same in ALL languages
static const ImGuiLocEntry GLocalizationEntriesEnUS[] = static const ImGuiLocEntry GLocalizationEntriesEnUS[] =
{ {
{ ImGuiLocKey_VersionStr, "Dear ImGui " IMGUI_VERSION " (" IM_STRINGIFY(IMGUI_VERSION_NUM) ")" },
{ ImGuiLocKey_TableSizeOne, "Size column to fit###SizeOne" }, { ImGuiLocKey_TableSizeOne, "Size column to fit###SizeOne" },
{ ImGuiLocKey_TableSizeAllFit, "Size all columns to fit###SizeAll" }, { ImGuiLocKey_TableSizeAllFit, "Size all columns to fit###SizeAll" },
{ ImGuiLocKey_TableSizeAllDefault, "Size all columns to default###SizeAll" }, { ImGuiLocKey_TableSizeAllDefault, "Size all columns to default###SizeAll" },

View File

@ -5940,10 +5940,11 @@ void ImGui::ShowAboutWindow(bool* p_open)
return; return;
} }
IMGUI_DEMO_MARKER("Tools/About Dear ImGui"); IMGUI_DEMO_MARKER("Tools/About Dear ImGui");
ImGui::Text("Dear ImGui %s", ImGui::GetVersion()); ImGui::Text("Dear ImGui %s (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM);
ImGui::Separator(); ImGui::Separator();
ImGui::Text("By Omar Cornut and all Dear ImGui contributors."); ImGui::Text("By Omar Cornut and all Dear ImGui contributors.");
ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information."); ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information.");
ImGui::Text("If your company uses this, please consider sponsoring the project!");
static bool show_config_info = false; static bool show_config_info = false;
ImGui::Checkbox("Config/Build Information", &show_config_info); ImGui::Checkbox("Config/Build Information", &show_config_info);

View File

@ -268,6 +268,8 @@ namespace ImStb
#define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255 #define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255
#define IM_FLOOR(_VAL) ((float)(int)(_VAL)) // ImFloor() is not inlined in MSVC debug builds #define IM_FLOOR(_VAL) ((float)(int)(_VAL)) // ImFloor() is not inlined in MSVC debug builds
#define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f)) // #define IM_ROUND(_VAL) ((float)(int)((_VAL) + 0.5f)) //
#define IM_STRINGIFY_HELPER(_X) #_X
#define IM_STRINGIFY(_X) IM_STRINGIFY_HELPER(_X) // Preprocessor idiom to stringify e.g. an integer.
// Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall // Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall
#ifdef _MSC_VER #ifdef _MSC_VER
@ -1654,6 +1656,7 @@ struct ImGuiSettingsHandler
// This is experimental and not officially supported, it'll probably fall short of features, if/when it does we may backtrack. // This is experimental and not officially supported, it'll probably fall short of features, if/when it does we may backtrack.
enum ImGuiLocKey : int enum ImGuiLocKey : int
{ {
ImGuiLocKey_VersionStr,
ImGuiLocKey_TableSizeOne, ImGuiLocKey_TableSizeOne,
ImGuiLocKey_TableSizeAllFit, ImGuiLocKey_TableSizeAllFit,
ImGuiLocKey_TableSizeAllDefault, ImGuiLocKey_TableSizeAllDefault,