| 1684 | } |
| 1685 | } // namespace |
| 1686 | |
| 1687 | void Init(SDL_Window* window, void* glContext) |
| 1688 | { |
| 1689 | if (s_initialized) |
| 1690 | return; |
| 1691 | s_window = window; |
| 1692 | |
| 1693 | IMGUI_CHECKVERSION(); |
| 1694 | ImGui::CreateContext(); |
| 1695 | ImGuiIO& io = ImGui::GetIO(); |
| 1696 | io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; |
| 1697 | io.IniFilename = nullptr; // no imgui.ini side-effects |
| 1698 | ImGui::StyleColorsDark(); |
| 1699 | |
| 1700 | if (!ImGui_ImplSDL3_InitForOpenGL(window, glContext)) |
| 1701 | { |
| 1702 | LOG_ERROR(Graphics, "DebugOverlay: ImGui_ImplSDL3_InitForOpenGL failed"); |
| 1703 | return; |
| 1704 | } |
| 1705 | if (!ImGui_ImplOpenGL3_Init("#version 330")) |
| 1706 | { |
| 1707 | LOG_ERROR(Graphics, "DebugOverlay: ImGui_ImplOpenGL3_Init failed"); |
| 1708 | return; |
| 1709 | } |
| 1710 | |
| 1711 | s_initialized = true; |
| 1712 | LOG_INFO(Graphics, "DebugOverlay: ImGui initialized (press Ctrl+` / Ctrl+; to toggle)"); |
| 1713 | } |
| 1714 | |
| 1715 | void Shutdown() |
no test coverage detected