summaryrefslogtreecommitdiff
path: root/dispatch
diff options
context:
space:
mode:
Diffstat (limited to 'dispatch')
-rw-r--r--dispatch/glproc.py60
1 files changed, 59 insertions, 1 deletions
diff --git a/dispatch/glproc.py b/dispatch/glproc.py
index 81c30ad4..a94cefee 100644
--- a/dispatch/glproc.py
+++ b/dispatch/glproc.py
@@ -504,11 +504,69 @@ class GlDispatcher(Dispatcher):
def failFunction(self, function):
# We fake these when they are not available
if sys.platform == 'darwin':
- # Fallback to EXT_debug_label on MacOSX
+ # Fallback to EXT_debug_label on MacOSX, some enums need to be translated.
if function.name == 'glObjectLabel':
+ print r' switch(identifier) {'
+ print r' case GL_TEXTURE:'
+ print r' case GL_FRAMEBUFFER:'
+ print r' case GL_RENDERBUFFER:'
+ print r' case GL_SAMPLER:'
+ print r' case GL_TRANSFORM_FEEDBACK:'
+ print r' break;'
+ print r' case GL_BUFFER:'
+ print r' identifier = GL_BUFFER_OBJECT_EXT;'
+ print r' break;'
+ print r' case GL_SHADER:'
+ print r' identifier = GL_SHADER_OBJECT_EXT;'
+ print r' break;'
+ print r' case GL_PROGRAM:'
+ print r' identifier = GL_PROGRAM_OBJECT_EXT;'
+ print r' break;'
+ print r' case GL_VERTEX_ARRAY:'
+ print r' identifier = GL_VERTEX_ARRAY_OBJECT_EXT;'
+ print r' break;'
+ print r' case GL_QUERY:'
+ print r' identifier = GL_QUERY_OBJECT_EXT;'
+ print r' break;'
+ print r' case GL_PROGRAM_PIPELINE:'
+ print r' identifier = GL_PROGRAM_PIPELINE_OBJECT_EXT;'
+ print r' break;'
+ print r' default:'
+ print r' return;'
+ print r' }'
print r' _glLabelObjectEXT(identifier, name, length < 0 ? 0 : length, length == 0 ? "" : label);'
return
if function.name == 'glGetObjectLabel':
+ print r' switch(identifier) {'
+ print r' case GL_TEXTURE:'
+ print r' case GL_FRAMEBUFFER:'
+ print r' case GL_RENDERBUFFER:'
+ print r' case GL_SAMPLER:'
+ print r' case GL_TRANSFORM_FEEDBACK:'
+ print r' break;'
+ print r' case GL_BUFFER:'
+ print r' identifier = GL_BUFFER_OBJECT_EXT;'
+ print r' break;'
+ print r' case GL_SHADER:'
+ print r' identifier = GL_SHADER_OBJECT_EXT;'
+ print r' break;'
+ print r' case GL_PROGRAM:'
+ print r' identifier = GL_PROGRAM_OBJECT_EXT;'
+ print r' break;'
+ print r' case GL_VERTEX_ARRAY:'
+ print r' identifier = GL_VERTEX_ARRAY_OBJECT_EXT;'
+ print r' break;'
+ print r' case GL_QUERY:'
+ print r' identifier = GL_QUERY_OBJECT_EXT;'
+ print r' break;'
+ print r' case GL_PROGRAM_PIPELINE:'
+ print r' identifier = GL_PROGRAM_PIPELINE_OBJECT_EXT;'
+ print r' break;'
+ print r' default:'
+ print r' if (length != 0) *length = 0;'
+ print r' if (label != 0 && bufSize > 0) *label = 0;'
+ print r' return;'
+ print r' }'
print r' _glGetObjectLabelEXT(identifier, name, bufSize, length, label);'
return
if function.name in (