def header(self):
print '''
#if defined(_WIN32)
-extern HINSTANCE _libGlHandle;
+extern HMODULE _libGlHandle;
#else
extern void * _libGlHandle;
#endif
void * _getPrivateProcAddress(const char *procName);
'''
- def isFunctionPublic(self, function):
+ def isFunctionPublic(self, module, function):
return function.name in public_symbols or function.name.startswith('CGL')
+ def failFunction(self, function):
+ # We fake this when they are not available
+ if function.name in ('glGetObjectLabel', 'glGetObjectPtrLabel'):
+ 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)
+
if __name__ == '__main__':
print
print
dispatcher.header()
print
- dispatcher.dispatch_api(eglapi)
+ dispatcher.dispatchModule(eglapi)
print
print '#if defined(_WIN32)'
print
- dispatcher.dispatch_api(wglapi)
+ dispatcher.dispatchModule(wglapi)
print
print '#elif defined(__APPLE__)'
print
- dispatcher.dispatch_api(cglapi)
+ dispatcher.dispatchModule(cglapi)
print
print '#elif defined(HAVE_X11)'
print
- dispatcher.dispatch_api(glxapi)
+ dispatcher.dispatchModule(glxapi)
print
print '#endif'
print
- dispatcher.dispatch_api(glapi)
+ dispatcher.dispatchModule(glapi)
print
- dispatcher.dispatch_api(glesapi)
+ dispatcher.dispatchModule(glesapi)
print
print '#endif /* !_GLPROC_HPP_ */'