From df540cedea4386711a77129881e309dad9e40ad4 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 12 Feb 2017 16:40:54 -0400 Subject: [PATCH] Enable OpenGL debug group markers outside of iOS --HG-- branch : minor --- src/modules/graphics/opengl/OpenGL.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/modules/graphics/opengl/OpenGL.h b/src/modules/graphics/opengl/OpenGL.h index ef0147742..af5c52554 100644 --- a/src/modules/graphics/opengl/OpenGL.h +++ b/src/modules/graphics/opengl/OpenGL.h @@ -101,23 +101,25 @@ public: { public: -#if defined(LOVE_IOS) TempDebugGroup(const char *name) { - if (GLAD_EXT_debug_marker) + if (GLAD_VERSION_4_3 || (GLAD_KHR_debug && !GLAD_ES_VERSION_2_0)) + glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, 0, (const GLchar *) name); + else if (GLAD_ES_VERSION_2_0 && GLAD_KHR_debug) + glPushDebugGroupKHR(GL_DEBUG_SOURCE_APPLICATION, 0, 0, (const GLchar *) name); + else if (GLAD_EXT_debug_marker) glPushGroupMarkerEXT(0, (const GLchar *) name); } -#else - TempDebugGroup(const char *) {} -#endif -#if defined(LOVE_IOS) ~TempDebugGroup() { - if (GLAD_EXT_debug_marker) + if (GLAD_VERSION_4_3 || (GLAD_KHR_debug && !GLAD_ES_VERSION_2_0)) + glPopDebugGroup(); + else if (GLAD_ES_VERSION_2_0 && GLAD_KHR_debug) + glPopDebugGroupKHR(); + else if (GLAD_EXT_debug_marker) glPopGroupMarkerEXT(); } -#endif }; struct Stats