diff pytouhou/ui/opengl/backend.pyx @ 579:b8df946d394d

Add grouping for OpenGL calls, making traces much more readable.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 17 Aug 2014 16:16:58 +0200
parents 1be60813f7cb
children 6e79756b7f42
line wrap: on
line diff
--- a/pytouhou/ui/opengl/backend.pyx
+++ b/pytouhou/ui/opengl/backend.pyx
@@ -4,7 +4,8 @@ from pytouhou.lib.sdl cimport Window
 from pytouhou.lib.opengl cimport \
          (glEnable, glHint, glEnableClientState, GL_TEXTURE_2D, GL_BLEND,
           GL_PERSPECTIVE_CORRECTION_HINT, GL_FOG_HINT, GL_NICEST,
-          GL_COLOR_ARRAY, GL_VERTEX_ARRAY, GL_TEXTURE_COORD_ARRAY)
+          GL_COLOR_ARRAY, GL_VERTEX_ARRAY, GL_TEXTURE_COORD_ARRAY,
+          glPushDebugGroup, GL_DEBUG_SOURCE_APPLICATION, glPopDebugGroup)
 
 
 GameRenderer = None
@@ -65,6 +66,7 @@ def create_window(title, x, y, width, he
     window.gl_create_context()
 
     # Initialize OpenGL
+    glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, "OpenGL initialisation")
     glEnable(GL_BLEND)
     if is_legacy:
         glEnable(GL_TEXTURE_2D)
@@ -73,5 +75,6 @@ def create_window(title, x, y, width, he
         glEnableClientState(GL_COLOR_ARRAY)
         glEnableClientState(GL_VERTEX_ARRAY)
         glEnableClientState(GL_TEXTURE_COORD_ARRAY)
+    glPopDebugGroup()
 
     return window