|
@@ -64,6 +64,32 @@ static void *LOVEGetProcAddress(const char *name)
|
|
|
return SDL_GL_GetProcAddress(name);
|
|
|
}
|
|
|
|
|
|
+OpenGL::TempDebugGroup::TempDebugGroup(const char *name)
|
|
|
+{
|
|
|
+ if (isDebugEnabled())
|
|
|
+ {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+OpenGL::TempDebugGroup::~TempDebugGroup()
|
|
|
+{
|
|
|
+ if (isDebugEnabled())
|
|
|
+ {
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
OpenGL::OpenGL()
|
|
|
: stats()
|
|
|
, contextInitialized(false)
|