Skip to content

Commit

Permalink
dispatch: Don't rely on sys.platform to generate glproc.
Browse files Browse the repository at this point in the history
Fixes #483
  • Loading branch information
jrfonseca committed Sep 2, 2016
1 parent 5d5d82b commit d277370
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions dispatch/glproc.py
Expand Up @@ -502,19 +502,23 @@ def getProcAddressName(self, module, function):
return '_getPrivateProcAddress'

def failFunction(self, function):
# Fallback to EXT_debug_label on MacOSX, some enums need to be translated.
if function.name in ('glObjectLabel', 'glObjectLabelKHR'):
print r'#ifdef __APPLE__'
print r' if (translateDebugLabelIdentifier(identifier)) {'
print r' _glLabelObjectEXT(identifier, name, length < 0 ? 0 : length, length == 0 ? "" : label);'
print r' return;'
print r' }'
print r'#endif'
if function.name in ('glGetObjectLabel', 'glGetObjectLabelKHR'):
print r'#ifdef __APPLE__'
print r' if (translateDebugLabelIdentifier(identifier)) {'
print r' _glGetObjectLabelEXT(identifier, name, bufSize, length, label);'
print r' return;'
print r' }'
print r'#endif'

# We fake these when they are not available
if sys.platform == 'darwin':
# Fallback to EXT_debug_label on MacOSX, some enums need to be translated.
if function.name in ('glObjectLabel', 'glObjectLabelKHR'):
print r' if (translateDebugLabelIdentifier(identifier)) {'
print r' _glLabelObjectEXT(identifier, name, length < 0 ? 0 : length, length == 0 ? "" : label);'
print r' return;'
print r' }'
if function.name in ('glGetObjectLabel', 'glGetObjectLabelKHR'):
print r' if (translateDebugLabelIdentifier(identifier)) {'
print r' _glGetObjectLabelEXT(identifier, name, bufSize, length, label);'
print r' return;'
print r' }'
if function.name in (
# GL_KHR_debug
'glDebugMessageControl',
Expand Down

0 comments on commit d277370

Please sign in to comment.