IMGUI_STB_NAMESPACE define Stb stuff in a namespace (trying stuff to reduce problems with multiple implementations)

This commit is contained in:
ocornut 2015-01-21 11:54:23 +01:00
parent 9524d76fe8
commit 26f93e6660

View File

@ -331,6 +331,15 @@
// STB libraries implementation // STB libraries implementation
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
struct ImGuiTextEditState;
//#define IMGUI_STB_NAMESPACE ImStb
#ifdef IMGUI_STB_NAMESPACE
namespace IMGUI_STB_NAMESPACE
{
#endif
#ifdef __clang__ #ifdef __clang__
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function" #pragma clang diagnostic ignored "-Wunused-function"
@ -338,15 +347,16 @@
#endif #endif
#define STBRP_STATIC #define STBRP_STATIC
#define STBRP_ASSERT(x) IM_ASSERT(x)
#define STB_RECT_PACK_IMPLEMENTATION #define STB_RECT_PACK_IMPLEMENTATION
#include "stb_rect_pack.h" #include "stb_rect_pack.h"
#define STB_TRUETYPE_IMPLEMENTATION #define STB_TRUETYPE_IMPLEMENTATION
#define STBTT_malloc(x,u) ((void)(u), ImGui::MemAlloc(x)) #define STBTT_malloc(x,u) ((void)(u), ImGui::MemAlloc(x))
#define STBTT_free(x,u) ((void)(u), ImGui::MemFree(x)) #define STBTT_free(x,u) ((void)(u), ImGui::MemFree(x))
#define STBTT_assert(x) IM_ASSERT(x)
#include "stb_truetype.h" #include "stb_truetype.h"
struct ImGuiTextEditState;
#define STB_TEXTEDIT_STRING ImGuiTextEditState #define STB_TEXTEDIT_STRING ImGuiTextEditState
#define STB_TEXTEDIT_CHARTYPE ImWchar #define STB_TEXTEDIT_CHARTYPE ImWchar
#include "stb_textedit.h" #include "stb_textedit.h"
@ -355,6 +365,11 @@ struct ImGuiTextEditState;
#pragma clang diagnostic pop #pragma clang diagnostic pop
#endif #endif
#ifdef IMGUI_STB_NAMESPACE
} // namespace ImStb
using namespace IMGUI_STB_NAMESPACE;
#endif
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// Forward Declarations // Forward Declarations
//------------------------------------------------------------------------- //-------------------------------------------------------------------------