From 109ae75fb25206dd66277401024bc3f884efc0a2 Mon Sep 17 00:00:00 2001 From: Pcornat Date: Fri, 8 Apr 2022 23:13:38 +0200 Subject: [PATCH] Better like this: glClear is in the framebuffer callback. --- src/gui/gui.cpp | 1 - src/gui/window.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index e1c9b50..82dfcce 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -108,7 +108,6 @@ void gui::Gui::render_gui(const Controller &controller) { void gui::Gui::render_gpu() const { if (initialized) { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); } } diff --git a/src/gui/window.cpp b/src/gui/window.cpp index 6785023..7da3719 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -8,6 +8,7 @@ static void glfwErrorCallback(int error, const char *message) { static void framebufferCallback([[maybe_unused]] GLFWwindow *glfWwindow, int width, int height) { glViewport(0, 0, width, height); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); } gui::Window::Window() {