From a68eebbfe731e6a140d109dfee55ccc11941a574 Mon Sep 17 00:00:00 2001 From: korenkonder Date: Mon, 10 Jun 2024 02:11:18 +0300 Subject: [PATCH] Better way of doing `glDebugGroup`s --- src/CRE/gl_state.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CRE/gl_state.hpp b/src/CRE/gl_state.hpp index dbe5b3a5..9a0103d5 100644 --- a/src/CRE/gl_state.hpp +++ b/src/CRE/gl_state.hpp @@ -114,10 +114,11 @@ extern void gl_state_set_primitive_restart_index(GLuint index, bool force = fals extern void gl_state_set_stencil_mask(GLuint mask, bool force = false); extern void gl_state_use_program(GLuint program, bool force = false); -inline constexpr void gl_state_begin_event(const char* str) { - glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, (GLsizei)utf8_length(str), str); +template +inline void gl_state_begin_event(const char(&str)[size]) { + glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, (GLsizei)(size - 1), str); } -inline constexpr void gl_state_end_event() { +inline void gl_state_end_event() { glPopDebugGroup(); }