![]() Example App: Property Editor / ShowExampleAppPropertyEditor() Example App: Simple Layout / ShowExampleAppLayout() Example App: Debug Log / ShowExampleAppLog() Example App: Debug Console / ShowExampleAppConsole() Example App: Main Menu Bar / ShowExampleAppMainMenuBar() Because we can't assume anything about your support of maths operators, we cannot use them in imgui_demo.cpp. and require you either enable those, either provide your own via IM_VEC2_CLASS_EXTRA in imconfig.h. For your own sources file they are optional by imgui_internal.h using the IMGUI_DEFINE_MATH_OPERATORS define. ![]() For our other sources files we use them, and they are provided - We never use maths operators on ImVec2/ImVec4. - We never use any of the helpers/facilities used internally by Dear ImGui, unless available in the public API. - We try to declare static variables in the local scope, as close as possible to the code using them. - We never omit the ImGui:: prefix when calling functions, even though most code here is in the same namespace. The Demo code in this file is designed to be easy to copy-and-paste in into your application! but most of the real data you would be editing is likely going to be stored outside your functions. ![]() This might be a pattern you will want to use in your code, doesn't need to be reentrant or used in multiple threads. It also happens to be a convenient way of storing simple UI related information as long as your function gather code and data in the same place, to make the demo source code faster to read, faster to write, and smaller so it is essentially like a global variable but declared inside the scope of the function. In this demo code, we frequently we use 'static' variables inside functions. Message to beginner C/C++ programmers about the meaning of the 'static' keyword: -Your beloved friend, imgui_demo.cpp (which you won't delete) In other situation, whenever you have Dear ImGui available you probably want this to be available for reference. linked, you can setup your imconfig.h with #define IMGUI_DISABLE_DEMO_WINDOWS and those functions will be empty. ![]() If you want to link core Dear ImGui in your shipped builds but want a thorough guarantee that the demo will not be Everything in this file will be stripped out by the linker if you don't call ImGui::ShowDemoWindow(). in your team, likely leading you to poorer usage of the library. debug menu of your game/app! Removing this file from your project is hindering access to documentation for everyone Have the ImGui::ShowDemoWindow() function wired in an always-available coders will want to refer to and call. Do NOT remove this file from your project! Think again! It is the most useful reference code that you and other Message to the person tempted to delete this file when integrating Dear ImGui into their code base: Read imgui.cpp for more details, documentation and comments. All applications in examples/ are doing that. - Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp. - Newcomers, read 'Programmer guide' in imgui.cpp for notes on how to setup Dear ImGui in your codebase. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |