def failFunction(self, function): # We fake this when they are not available if function.name in ('glGetObjectLabel', 'glGetObjectPtrLabel', 'glGetObjectLabelEXT'): print r' if (length != 0) *length = 0;' print r' if (label != 0 && bufSize > 0) *label = 0;' return if function.name in ('glGetDebugMessageLog', 'glGetDebugMessageLogARB'): print r' if (sources != 0) *sources = 0;' print r' if (types != 0) *types = 0;' print r' if (ids != 0) *ids = 0;' print r' if (severities != 0) *severities = 0;' print r' if (lengths != 0) *lengths = 0;' print r' if (messageLog != 0 && bufsize > 0) *messageLog = 0;' return if function.name in ('glGetDebugMessageLogAMD'): print r' if (categories != 0) *categories = 0;' print r' if (ids != 0) *ids = 0;' print r' if (severities != 0) *severities = 0;' print r' if (lengths != 0) *lengths = 0;' print r' if (message != 0 && bufsize > 0) *message = 0;' return Dispatcher.failFunction(self, function)
def failFunction(self, function): # We fake these when they are not available if sys.platform == 'darwin': # Fallback to EXT_debug_label on MacOSX if function.name == 'glObjectLabel': print r' _glLabelObjectEXT(identifier, name, length < 0 ? 0 : length, length == 0 ? "" : label);' return if function.name == 'glGetObjectLabel': print r' _glGetObjectLabelEXT(identifier, name, bufSize, length, label);' return if function.name in ( # GL_KHR_debug 'glDebugMessageControl', 'glDebugMessageInsert', 'glDebugMessageCallback', 'glPushDebugGroup', 'glPopDebugGroup', 'glObjectLabel', 'glObjectPtrLabel', # GL_ARB_debug_output 'glDebugMessageControlARB', 'glDebugMessageInsertARB', 'glDebugMessageCallbackARB', # GL_AMD_debug_output 'glDebugMessageEnableAMD', 'glDebugMessageInsertAMD', 'glDebugMessageCallbackAMD', # GL_EXT_debug_label 'glLabelObjectEXT', # GL_EXT_debug_marker 'glInsertEventMarkerEXT', 'glPushGroupMarkerEXT', 'glPopGroupMarkerEXT', ): return if function.name in ('glGetObjectLabel', 'glGetObjectPtrLabel', 'glGetObjectLabelEXT'): print r' if (length != 0) *length = 0;' print r' if (label != 0 && bufSize > 0) *label = 0;' return if function.name in ('glGetDebugMessageLog', 'glGetDebugMessageLogARB'): print r' if (sources != 0) *sources = 0;' print r' if (types != 0) *types = 0;' print r' if (ids != 0) *ids = 0;' print r' if (severities != 0) *severities = 0;' print r' if (lengths != 0) *lengths = 0;' print r' if (messageLog != 0 && bufsize > 0) *messageLog = 0;' print r' return 0;' return if function.name in ('glGetDebugMessageLogAMD'): print r' if (categories != 0) *categories = 0;' print r' if (ids != 0) *ids = 0;' print r' if (severities != 0) *severities = 0;' print r' if (lengths != 0) *lengths = 0;' print r' if (message != 0 && bufsize > 0) *message = 0;' print r' return 0;' return Dispatcher.failFunction(self, function)
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 function.name in ( # GL_KHR_debug 'glDebugMessageControl', 'glDebugMessageInsert', 'glDebugMessageCallback', 'glPushDebugGroup', 'glPopDebugGroup', 'glObjectLabel', 'glObjectPtrLabel', # GL_KHR_debug (OpenGL ES) 'glDebugMessageControlKHR', 'glDebugMessageInsertKHR', 'glDebugMessageCallbackKHR', 'glPushDebugGroupKHR', 'glPopDebugGroupKHR', 'glObjectLabelKHR', 'glObjectPtrLabelKHR', # GL_ARB_debug_output 'glDebugMessageControlARB', 'glDebugMessageInsertARB', 'glDebugMessageCallbackARB', # GL_AMD_debug_output 'glDebugMessageEnableAMD', 'glDebugMessageInsertAMD', 'glDebugMessageCallbackAMD', # GL_EXT_debug_label 'glLabelObjectEXT', # GL_EXT_debug_marker 'glInsertEventMarkerEXT', 'glPushGroupMarkerEXT', 'glPopGroupMarkerEXT', ): return if function.name.startswith('glGetObjectLabel'): print r' if (length != 0) *length = 0;' print r' if (label != 0 && bufSize > 0) *label = 0;' return if function.name == 'glGetDebugMessageLogAMD': print r' if (categories != 0) *categories = 0;' print r' if (ids != 0) *ids = 0;' print r' if (severities != 0) *severities = 0;' print r' if (lengths != 0) *lengths = 0;' print r' if (message != 0 && bufsize > 0) *message = 0;' print r' return 0;' return if function.name.startswith('glGetDebugMessageLog'): print r' if (sources != 0) *sources = 0;' print r' if (types != 0) *types = 0;' print r' if (ids != 0) *ids = 0;' print r' if (severities != 0) *severities = 0;' print r' if (lengths != 0) *lengths = 0;' print r' if (messageLog != 0 && bufsize > 0) *messageLog = 0;' print r' return 0;' return Dispatcher.failFunction(self, function)