Enabled imgui viewports

This commit is contained in:
Antoine Pilote
2023-09-25 17:28:43 -04:00
parent d843d54388
commit 96bed6351e
7 changed files with 66 additions and 24 deletions

View File

@@ -155,8 +155,20 @@ namespace Nuake
void Window::EndDraw()
{
ImGui::EndFrame();
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
if (ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
{
GLFWwindow* backup_current_context = glfwGetCurrentContext();
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindowsDefault();
glfwMakeContextCurrent(backup_current_context);
}
glfwSwapBuffers(m_Window);
glfwPollEvents();
}
@@ -263,6 +275,7 @@ namespace Nuake
io.Fonts->AddFontFromFileTTF("resources/Fonts/Poppins-Regular.ttf", 16.0);
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
ImGui::StyleColorsDark();
ImGuiStyle& s = ImGui::GetStyle();