Browse Source

Add config.h for ImGUI

Panagiotis Christopoulos Charitos 6 years ago
parent
commit
1e0fdf7eda
4 changed files with 11 additions and 1 deletions
  1. 3 0
      CMakeLists.txt
  2. 5 0
      src/anki/ui/Common.h
  3. 2 0
      src/anki/ui/UiManager.cpp
  4. 1 1
      thirdparty

+ 3 - 0
CMakeLists.txt

@@ -155,6 +155,9 @@ add_definitions(-DGLEW_NO_GLU)
 add_definitions(-DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
 add_definitions(-DANKI_BUILD)
 
+# ImGUI
+add_definitions(-DIMGUI_USER_CONFIG=<anki/ui/ImGuiConfig.h>)
+
 if(NOT MSVC)
 	# When building AnKi define this special flag
 	set(COMPILER_FLAGS "${COMPILER_FLAGS} -fPIC ")

+ 5 - 0
src/anki/ui/Common.h

@@ -6,6 +6,11 @@
 #pragma once
 
 #include <anki/ui/NuklearConfig.h>
+
+// Include ImGUI
+#include <anki/ui/ImGuiConfig.h>
+#include <imgui/imgui.h>
+
 #include <anki/util/Allocator.h>
 
 namespace anki

+ 2 - 0
src/anki/ui/UiManager.cpp

@@ -8,6 +8,8 @@
 namespace anki
 {
 
+thread_local ImGuiContext* g_imguiTlsCtx = nullptr;
+
 UiManager::UiManager()
 {
 }

+ 1 - 1
thirdparty

@@ -1 +1 @@
-Subproject commit 9b414a1a3b6c6fbcbb2ed71d1c84f3f8889dab35
+Subproject commit a9a9dad78989ee9d8f9b00687a9b78852aac2dda