Better like this: glClear is in the framebuffer callback.

This commit is contained in:
Pcornat 2022-04-08 23:13:38 +02:00
parent 58af31be5e
commit 109ae75fb2
2 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,6 @@ void gui::Gui::render_gui(const Controller &controller) {
void gui::Gui::render_gpu() const { void gui::Gui::render_gpu() const {
if (initialized) { if (initialized) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
} }
} }

View File

@ -8,6 +8,7 @@ static void glfwErrorCallback(int error, const char *message) {
static void framebufferCallback([[maybe_unused]] GLFWwindow *glfWwindow, int width, int height) { static void framebufferCallback([[maybe_unused]] GLFWwindow *glfWwindow, int width, int height) {
glViewport(0, 0, width, height); glViewport(0, 0, width, height);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
} }
gui::Window::Window() { gui::Window::Window() {