Mercurial > touhou
comparison 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 |
comparison
equal
deleted
inserted
replaced
578:00f228b57840 | 579:b8df946d394d |
---|---|
2 from pytouhou.lib.sdl cimport Window | 2 from pytouhou.lib.sdl cimport Window |
3 | 3 |
4 from pytouhou.lib.opengl cimport \ | 4 from pytouhou.lib.opengl cimport \ |
5 (glEnable, glHint, glEnableClientState, GL_TEXTURE_2D, GL_BLEND, | 5 (glEnable, glHint, glEnableClientState, GL_TEXTURE_2D, GL_BLEND, |
6 GL_PERSPECTIVE_CORRECTION_HINT, GL_FOG_HINT, GL_NICEST, | 6 GL_PERSPECTIVE_CORRECTION_HINT, GL_FOG_HINT, GL_NICEST, |
7 GL_COLOR_ARRAY, GL_VERTEX_ARRAY, GL_TEXTURE_COORD_ARRAY) | 7 GL_COLOR_ARRAY, GL_VERTEX_ARRAY, GL_TEXTURE_COORD_ARRAY, |
8 glPushDebugGroup, GL_DEBUG_SOURCE_APPLICATION, glPopDebugGroup) | |
8 | 9 |
9 | 10 |
10 GameRenderer = None | 11 GameRenderer = None |
11 | 12 |
12 | 13 |
63 | 64 |
64 window = Window(title, x, y, width, height, flags) | 65 window = Window(title, x, y, width, height, flags) |
65 window.gl_create_context() | 66 window.gl_create_context() |
66 | 67 |
67 # Initialize OpenGL | 68 # Initialize OpenGL |
69 glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, "OpenGL initialisation") | |
68 glEnable(GL_BLEND) | 70 glEnable(GL_BLEND) |
69 if is_legacy: | 71 if is_legacy: |
70 glEnable(GL_TEXTURE_2D) | 72 glEnable(GL_TEXTURE_2D) |
71 glHint(GL_FOG_HINT, GL_NICEST) | 73 glHint(GL_FOG_HINT, GL_NICEST) |
72 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) | 74 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) |
73 glEnableClientState(GL_COLOR_ARRAY) | 75 glEnableClientState(GL_COLOR_ARRAY) |
74 glEnableClientState(GL_VERTEX_ARRAY) | 76 glEnableClientState(GL_VERTEX_ARRAY) |
75 glEnableClientState(GL_TEXTURE_COORD_ARRAY) | 77 glEnableClientState(GL_TEXTURE_COORD_ARRAY) |
78 glPopDebugGroup() | |
76 | 79 |
77 return window | 80 return window |