ImGuiConfig.h 916 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (C) 2009-2021, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <AnKi/Util/Assert.h>
  7. #include <AnKi/Math.h>
  8. #define IM_ASSERT(_EXPR) ANKI_ASSERT(_EXPR)
  9. #define IMGUI_DISABLE_OBSOLETE_FUNCTIONS 1
  10. #define IMGUI_DISABLE_DEFAULT_ALLOCATORS 1
  11. #define IM_VEC2_CLASS_EXTRA \
  12. ImVec2(const anki::Vec2& f) \
  13. { \
  14. x = f.x(); \
  15. y = f.y(); \
  16. } \
  17. operator anki::Vec2() const \
  18. { \
  19. return anki::Vec2(x, y); \
  20. }
  21. #define IM_VEC4_CLASS_EXTRA \
  22. ImVec4(const anki::Vec4& f) \
  23. { \
  24. x = f.x(); \
  25. y = f.y(); \
  26. z = f.z(); \
  27. w = f.w(); \
  28. } \
  29. operator anki::Vec4() const \
  30. { \
  31. return anki::Vec4(x, y, z, w); \
  32. }
  33. // TLS context.
  34. struct ImGuiContext;
  35. namespace anki {
  36. extern thread_local ImGuiContext* g_imguiTlsCtx;
  37. } // end namespace anki
  38. #define GImGui anki::g_imguiTlsCtx