imgui: make sure our copy of imgui doesn't clash with others in the same process
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 22 Jan 2019 13:04:20 +0000 (13:04 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 21 Feb 2019 18:06:05 +0000 (18:06 +0000)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
+1-by: Mike Lothian <mike@fireburn.co.uk>
+1-by: Tapani Pälli <tapani.palli@intel.com>
+1-by: Eric Engestrom <eric.engestrom@intel.com>
+1-by: Yurii Kolesnykov <root@yurikoles.com>
+1-by: myfreeweb <greg@unrelenting.technology>
+1-by: Kenneth Graunke <kenneth@whitecape.org>

src/imgui/imconfig.h
src/intel/tools/aubinator_viewer.cpp

index 825505bf070993f1e92c8ee1045860b39a821098..877eb81923790e2e16611a3252eaa43bb8381347 100644 (file)
 
 #pragma once
 
 
 #pragma once
 
+// Have each embedded of ImGui define this symbol :
+struct ImGuiContext;
+extern thread_local ImGuiContext* __MesaImGui;
+#define GImGui __MesaImGui
+
 //---- Define assertion handler. Defaults to calling assert().
 //#define IM_ASSERT(_EXPR)  MyAssert(_EXPR)
 //#define IM_ASSERT(_EXPR)  ((void)(_EXPR))     // Disable asserts
 //---- Define assertion handler. Defaults to calling assert().
 //#define IM_ASSERT(_EXPR)  MyAssert(_EXPR)
 //#define IM_ASSERT(_EXPR)  ((void)(_EXPR))     // Disable asserts
index 4c11fe4b37dbf45d53c8f054498ca9edc2e56ddb..0c9cb77d7035da3ee7bf62223e5a2f0b08da3f15 100644 (file)
@@ -323,6 +323,8 @@ static struct Context {
    struct window registers_window;
 } context;
 
    struct window registers_window;
 } context;
 
+thread_local ImGuiContext* __MesaImGui;
+
 static int
 map_key(int k)
 {
 static int
 map_key(int k)
 {