| 4121 | } |
| 4122 | |
| 4123 | void ImGui::Initialize(ImGuiContext* context) |
| 4124 | { |
| 4125 | ImGuiContext& g = *context; |
| 4126 | IM_ASSERT(!g.Initialized && !g.SettingsLoaded); |
| 4127 | |
| 4128 | // Add .ini handle for ImGuiWindow type |
| 4129 | { |
| 4130 | ImGuiSettingsHandler ini_handler; |
| 4131 | ini_handler.TypeName = "Window"; |
| 4132 | ini_handler.TypeHash = ImHashStr("Window"); |
| 4133 | ini_handler.ClearAllFn = WindowSettingsHandler_ClearAll; |
| 4134 | ini_handler.ReadOpenFn = WindowSettingsHandler_ReadOpen; |
| 4135 | ini_handler.ReadLineFn = WindowSettingsHandler_ReadLine; |
| 4136 | ini_handler.ApplyAllFn = WindowSettingsHandler_ApplyAll; |
| 4137 | ini_handler.WriteAllFn = WindowSettingsHandler_WriteAll; |
| 4138 | g.SettingsHandlers.push_back(ini_handler); |
| 4139 | } |
| 4140 | |
| 4141 | #ifdef IMGUI_HAS_TABLE |
| 4142 | // Add .ini handle for ImGuiTable type |
| 4143 | TableSettingsInstallHandler(context); |
| 4144 | #endif // #ifdef IMGUI_HAS_TABLE |
| 4145 | |
| 4146 | // Create default viewport |
| 4147 | ImGuiViewportP* viewport = IM_NEW(ImGuiViewportP)(); |
| 4148 | g.Viewports.push_back(viewport); |
| 4149 | |
| 4150 | #ifdef IMGUI_HAS_DOCK |
| 4151 | #endif // #ifdef IMGUI_HAS_DOCK |
| 4152 | |
| 4153 | g.Initialized = true; |
| 4154 | } |
| 4155 | |
| 4156 | // This function is merely here to free heap allocations. |
| 4157 | void ImGui::Shutdown(ImGuiContext* context) |