Sfoglia il codice sorgente

Merge branch 'mmozeiko-allow-to-disable-test-window'

ocornut 10 anni fa
parent
commit
f32d92f842
2 ha cambiato i file con 12 aggiunte e 0 eliminazioni
  1. 3 0
      imconfig.h
  2. 9 0
      imgui.cpp

+ 3 - 0
imconfig.h

@@ -22,6 +22,9 @@
 //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS
 //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS
 
+//---- Don't implement help and test window functionality (ShowUserGuide()/ShowStyleEditor()/ShowTestWindow() methods will be empty)
+//#define IMGUI_DISABLE_TEST_WINDOWS
+
 //---- Include imgui_user.inl at the end of imgui.cpp so you can include code that extends ImGui using its private data/functions.
 //#define IMGUI_INCLUDE_IMGUI_USER_INL
 

+ 9 - 0
imgui.cpp

@@ -8807,6 +8807,14 @@ static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y)
 
 #endif
 
+#ifdef IMGUI_DISABLE_TEST_WINDOWS
+
+void ImGui::ShowUserGuide() {}
+void ImGui::ShowStyleEditor() {}
+void ImGui::ShowTestWindow() {}
+
+#else
+
 //-----------------------------------------------------------------------------
 // HELP
 //-----------------------------------------------------------------------------
@@ -10339,6 +10347,7 @@ static void ShowExampleAppLongText(bool* opened)
 }
 
 // End of Sample code
+#endif
 
 //-----------------------------------------------------------------------------
 // FONT DATA