From ea7206fd4fce6ac5690a48584a52cf67ead154e7 Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 21 Jan 2019 13:58:29 +0100 Subject: [PATCH] Fixed using imgui_freetype.cpp in unity builds. (#2302) --- docs/CHANGELOG.txt | 1 + misc/freetype/imgui_freetype.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 859f782d..b2b71e44 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -40,6 +40,7 @@ Other Changes: - ImGuiTextBuffer: Added append() function (unformatted). - ImFontAtlas: Added 0x2000-0x206F general punctuation range to default ChineseFull/ChineseSimplifiedCommon ranges. (#2093) - ImFontAtlas: FreeType: Added support for imgui allocators + custom FreeType only SetAllocatorFunctions. (#2285) [@Vuhdo] +- ImFontAtlas: FreeType: Fixed using imgui_freetype.cpp in unity builds. (#2302) - Examples: Win32: Using GetForegroundWindow()+IsChild() instead of GetActiveWindow() to be compatible with windows created in a different thread or parent. (#1951, #2087, #2156, #2232) [many people] - Examples: Win32: Added support for XInput games (if ImGuiConfigFlags_NavEnableGamepad is enabled). diff --git a/misc/freetype/imgui_freetype.cpp b/misc/freetype/imgui_freetype.cpp index a4a18119..1b3843b3 100644 --- a/misc/freetype/imgui_freetype.cpp +++ b/misc/freetype/imgui_freetype.cpp @@ -244,10 +244,12 @@ namespace } } +#ifndef STB_RECT_PACK_IMPLEMENTATION // in case the user already have an implementation in the _same_ compilation unit (e.g. unity builds) #define STBRP_ASSERT(x) IM_ASSERT(x) #define STBRP_STATIC #define STB_RECT_PACK_IMPLEMENTATION #include "imstb_rectpack.h" +#endif struct ImFontBuildSrcGlyphFT {