summaryrefslogtreecommitdiff
path: root/ui/window.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2026-01-16 02:53:57 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2026-01-16 03:18:29 +0000
commit09533ab9379a675a89638132fb6831b420ebb8f4 (patch)
tree984985821bcad18e0d8d93831150407e0d5b1a8e /ui/window.cpp
parentTidy thirdparty jam, use -isystem for thirdparty includes (diff)
downloadilt-09533ab9379a675a89638132fb6831b420ebb8f4.tar.bz2
ilt-09533ab9379a675a89638132fb6831b420ebb8f4.tar.xz
ilt-09533ab9379a675a89638132fb6831b420ebb8f4.zip
Add glDebugScope
Wrapper for glPushDebugGroup/glPopDebugGroup which allows neatly grouping OpenGL calls in diagnostic tools.
Diffstat (limited to 'ui/window.cpp')
-rw-r--r--ui/window.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/window.cpp b/ui/window.cpp
index c85cebe..9d8dc1a 100644
--- a/ui/window.cpp
+++ b/ui/window.cpp
@@ -1,6 +1,7 @@
#include "window.h"
#include "backends/imgui_impl_opengl3.h"
#include "backends/imgui_impl_sdl2.h"
+#include "gfx/gl/gldebug.h"
#include <glad/gl.h>
#include <glm/glm.hpp>
@@ -14,6 +15,7 @@ Window::Window(ScreenAbsCoord size, const char * title, Uint32 flags) :
void
Window::clear(float r, float g, float b, float a) const
{
+ glDebugScope _ {0};
glClearColor(r, g, b, a);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
@@ -56,8 +58,10 @@ Window::refresh() const
content->render();
// Render UI stuff here
}
- ImGui::Render();
- ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
+ if (glDebugScope _ {0, "ImGui post"}) {
+ ImGui::Render();
+ ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
+ }
swapBuffers();
}