MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / Initialize

Method Initialize

extern/imgui/imgui.cpp:5031–5069  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5029};
5030
5031void ImGui::Initialize()
5032{
5033 ImGuiContext& g = *GImGui;
5034 IM_ASSERT(!g.Initialized && !g.SettingsLoaded);
5035
5036 // Add .ini handle for ImGuiWindow and ImGuiTable types
5037 {
5038 ImGuiSettingsHandler ini_handler;
5039 ini_handler.TypeName = "Window";
5040 ini_handler.TypeHash = ImHashStr("Window");
5041 ini_handler.ClearAllFn = WindowSettingsHandler_ClearAll;
5042 ini_handler.ReadOpenFn = WindowSettingsHandler_ReadOpen;
5043 ini_handler.ReadLineFn = WindowSettingsHandler_ReadLine;
5044 ini_handler.ApplyAllFn = WindowSettingsHandler_ApplyAll;
5045 ini_handler.WriteAllFn = WindowSettingsHandler_WriteAll;
5046 AddSettingsHandler(&ini_handler);
5047 }
5048 TableSettingsAddSettingsHandler();
5049
5050 // Setup default localization table
5051 LocalizeRegisterEntries(GLocalizationEntriesEnUS, IM_ARRAYSIZE(GLocalizationEntriesEnUS));
5052
5053 // Create default viewport
5054 ImGuiViewportP* viewport = IM_NEW(ImGuiViewportP)();
5055 viewport->ID = IMGUI_VIEWPORT_DEFAULT_ID;
5056 viewport->Idx = 0;
5057 viewport->PlatformWindowCreated = true;
5058 viewport->Flags = ImGuiViewportFlags_OwnedByApp;
5059 g.Viewports.push_back(viewport);
5060 g.TempBuffer.resize(1024 * 3 + 1, 0);
5061 g.PlatformIO.Viewports.push_back(g.Viewports[0]);
5062
5063#ifdef IMGUI_HAS_DOCK
5064 // Initialize Docking
5065 DockContextInitialize(&g);
5066#endif
5067
5068 g.Initialized = true;
5069}
5070
5071// This function is merely here to free heap allocations.
5072void ImGui::Shutdown()

Callers

nothing calls this directly

Calls 3

ImHashStrFunction · 0.85
push_backMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected