Ver Fonte

Imgui: Add ability to link external STB libs.

Бранимир Караџић há 1 ano atrás
pai
commit
e4073f0259
1 ficheiros alterados com 25 adições e 21 exclusões
  1. 25 21
      examples/common/imgui/imgui.cpp

+ 25 - 21
examples/common/imgui/imgui.cpp

@@ -18,6 +18,10 @@
 #	define USE_ENTRY 0
 #endif // USE_ENTRY
 
+#ifndef USE_LOCAL_STB
+#	define USE_LOCAL_STB 1
+#endif // USE_LOCAL_STB
+
 #if USE_ENTRY
 #	include "../entry/entry.h"
 #	include "../entry/input.h"
@@ -564,29 +568,29 @@ namespace ImGui
 
 } // namespace ImGui
 
+#if USE_LOCAL_STB
 BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4505); // error C4505: '' : unreferenced local function has been removed
 BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wunused-function"); // warning: 'int rect_width_compare(const void*, const void*)' defined but not used
-BX_PRAGMA_DIAGNOSTIC_PUSH();
 BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunknown-pragmas")
 BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wtype-limits"); // warning: comparison is always true due to limited range of data type
 
-#define STBTT_ifloor(_a)   int32_t(bx::floor(_a) )
-#define STBTT_iceil(_a)    int32_t(bx::ceil(_a) )
-#define STBTT_sqrt(_a)     bx::sqrt(_a)
-#define STBTT_pow(_a, _b)  bx::pow(_a, _b)
-#define STBTT_fmod(_a, _b) bx::mod(_a, _b)
-#define STBTT_cos(_a)      bx::cos(_a)
-#define STBTT_acos(_a)     bx::acos(_a)
-#define STBTT_fabs(_a)     bx::abs(_a)
-#define STBTT_strlen(_str) bx::strLen(_str)
-
-#define STBTT_memcpy(_dst, _src, _numBytes) bx::memCopy(_dst, _src, _numBytes)
-#define STBTT_memset(_dst, _ch, _numBytes)  bx::memSet(_dst, _ch, _numBytes)
-#define STBTT_malloc(_size, _userData)      memAlloc(_size, _userData)
-#define STBTT_free(_ptr, _userData)         memFree(_ptr, _userData)
-
-#define STB_RECT_PACK_IMPLEMENTATION
-#include <stb/stb_rect_pack.h>
-#define STB_TRUETYPE_IMPLEMENTATION
-#include <stb/stb_truetype.h>
-BX_PRAGMA_DIAGNOSTIC_POP();
+#	define STBTT_ifloor(_a)   int32_t(bx::floor(_a) )
+#	define STBTT_iceil(_a)    int32_t(bx::ceil(_a) )
+#	define STBTT_sqrt(_a)     bx::sqrt(_a)
+#	define STBTT_pow(_a, _b)  bx::pow(_a, _b)
+#	define STBTT_fmod(_a, _b) bx::mod(_a, _b)
+#	define STBTT_cos(_a)      bx::cos(_a)
+#	define STBTT_acos(_a)     bx::acos(_a)
+#	define STBTT_fabs(_a)     bx::abs(_a)
+#	define STBTT_strlen(_str) bx::strLen(_str)
+
+#	define STBTT_memcpy(_dst, _src, _numBytes) bx::memCopy(_dst, _src, _numBytes)
+#	define STBTT_memset(_dst, _ch, _numBytes)  bx::memSet(_dst, _ch, _numBytes)
+#	define STBTT_malloc(_size, _userData)      memAlloc(_size, _userData)
+#	define STBTT_free(_ptr, _userData)         memFree(_ptr, _userData)
+
+#	define STB_RECT_PACK_IMPLEMENTATION
+#	include <stb/stb_rect_pack.h>
+#	define STB_TRUETYPE_IMPLEMENTATION
+#	include <stb/stb_truetype.h>
+#endif // USE_LOCAL_STB