print "#include <dlfcn.h>" print print '#include "trace_writer_local.hpp"' print print "// To validate our prototypes" print "#define GL_GLEXT_PROTOTYPES" print "#define EGL_EGLEXT_PROTOTYPES" print print '#include "glproc.hpp"' print '#include "glsize.hpp"' print print "static __eglMustCastToProperFunctionPointerType __unwrap_proc_addr(const char * procname, __eglMustCastToProperFunctionPointerType procPtr);" print api = API() api.add_api(eglapi) api.add_api(glapi) api.add_api(glesapi) tracer = EglTracer() tracer.trace_api(api) print "static __eglMustCastToProperFunctionPointerType __unwrap_proc_addr(const char * procname, __eglMustCastToProperFunctionPointerType procPtr) {" print " if (!procPtr) {" print " return procPtr;" print " }" for f in api.functions: ptype = function_pointer_type(f) pvalue = function_pointer_value(f) print ' if (!strcmp("%s", procname)) {' % f.name print " %s = (%s)procPtr;" % (pvalue, ptype) print " return (__eglMustCastToProperFunctionPointerType)&%s;" % (f.name,)
def handle_default(): print ' os::log("apitrace: warning: unknown function \\"%s\\"\\n", lpszProc);' string_switch('lpszProc', func_dict.keys(), handle_case, handle_default) print ' }' if __name__ == '__main__': print print '#define _GDI32_' print print '#include <string.h>' print '#include <windows.h>' print print '#include "trace_writer.hpp"' print '#include "os.hpp"' print print '// To validate our prototypes' print '#define GL_GLEXT_PROTOTYPES' print '#define WGL_GLXEXT_PROTOTYPES' print print '#include "glproc.hpp"' print '#include "glsize.hpp"' print api = API() api.add_api(glapi) api.add_api(wglapi) tracer = WglTracer() tracer.trace_api(api)
print '#ifndef _GNU_SOURCE' print '#define _GNU_SOURCE // for dladdr' print '#endif' print '#include <dlfcn.h>' print print '#include "trace_writer.hpp"' print print '// To validate our prototypes' print '#define GL_GLEXT_PROTOTYPES' print print '#include "glproc.hpp"' print '#include "glsize.hpp"' print api = API() api.add_api(cglapi) api.add_api(glapi) tracer = CglTracer() tracer.trace_api(api) print r''' /* * Path to the true OpenGL framework */ static const char *libgl_filename = "/System/Library/Frameworks/OpenGL.framework/OpenGL"; /* * Handle to the true OpenGL framework.
def handle_default(): print ' os::log("apitrace: warning: unknown function \\"%s\\"\\n", lpszProc);' string_switch('lpszProc', func_dict.keys(), handle_case, handle_default) print ' }' if __name__ == '__main__': print print '#define _GDI32_' print print '#include <string.h>' print '#include <windows.h>' print print '#include "trace_writer_local.hpp"' print '#include "os.hpp"' print print '// To validate our prototypes' print '#define GL_GLEXT_PROTOTYPES' print '#define WGL_GLXEXT_PROTOTYPES' print print '#include "glproc.hpp"' print '#include "glsize.hpp"' print api = API() api.add_api(glapi) api.add_api(wglapi) tracer = WglTracer() tracer.trace_api(api)
# The symbols visible in libGL.dylib can vary, so expose them all return True if __name__ == '__main__': print print '#include <stdlib.h>' print '#include <string.h>' print print '#include "trace_writer.hpp"' print print '// To validate our prototypes' print '#define GL_GLEXT_PROTOTYPES' print print '#include "glproc.hpp"' print '#include "glsize.hpp"' print api = API() api.add_api(cglapi) api.add_api(glapi) tracer = CglTracer() tracer.trace_api(api) print r''' PUBLIC void * gll_noop = 0; '''
print '#include <dlfcn.h>' print print '#include "trace_writer.hpp"' print print '// To validate our prototypes' print '#define GL_GLEXT_PROTOTYPES' print '#define EGL_EGLEXT_PROTOTYPES' print print '#include "glproc.hpp"' print '#include "glsize.hpp"' print print 'static __eglMustCastToProperFunctionPointerType __unwrap_proc_addr(const char * procname, __eglMustCastToProperFunctionPointerType procPtr);' print api = API() api.add_api(eglapi) api.add_api(glapi) api.add_api(glesapi) tracer = EglTracer() tracer.trace_api(api) print 'static __eglMustCastToProperFunctionPointerType __unwrap_proc_addr(const char * procname, __eglMustCastToProperFunctionPointerType procPtr) {' print ' if (!procPtr) {' print ' return procPtr;' print ' }' for f in api.functions: ptype = function_pointer_type(f) pvalue = function_pointer_value(f) print ' if (!strcmp("%s", procname)) {' % f.name print ' %s = (%s)procPtr;' % (pvalue, ptype) print ' return (__eglMustCastToProperFunctionPointerType)&%s;' % (
print '#include <dlfcn.h>' print print '#include "trace_writer.hpp"' print print '// To validate our prototypes' print '#define GL_GLEXT_PROTOTYPES' print '#define GLX_GLXEXT_PROTOTYPES' print print '#include "glproc.hpp"' print '#include "glsize.hpp"' print print 'static __GLXextFuncPtr __unwrap_proc_addr(const GLubyte * procName, __GLXextFuncPtr procPtr);' print api = API() api.add_api(glxapi) api.add_api(glapi) tracer = GlxTracer() tracer.trace_api(api) print 'static __GLXextFuncPtr __unwrap_proc_addr(const GLubyte * procName, __GLXextFuncPtr procPtr) {' print ' if (!procPtr) {' print ' return procPtr;' print ' }' for f in api.functions: ptype = function_pointer_type(f) pvalue = function_pointer_value(f) print ' if (strcmp("%s", (const char *)procName) == 0) {' % f.name print ' %s = (%s)procPtr;' % (pvalue, ptype) print ' return (__GLXextFuncPtr)&%s;' % (f.name, ) print ' }'
print '#include <dlfcn.h>' print print '#include "trace_writer_local.hpp"' print print '// To validate our prototypes' print '#define GL_GLEXT_PROTOTYPES' print '#define GLX_GLXEXT_PROTOTYPES' print print '#include "glproc.hpp"' print '#include "glsize.hpp"' print print 'static __GLXextFuncPtr __unwrap_proc_addr(const GLubyte * procName, __GLXextFuncPtr procPtr);' print api = API() api.add_api(glxapi) api.add_api(glapi) tracer = GlxTracer() tracer.trace_api(api) print 'static __GLXextFuncPtr __unwrap_proc_addr(const GLubyte * procName, __GLXextFuncPtr procPtr) {' print ' if (!procPtr) {' print ' return procPtr;' print ' }' for f in api.functions: ptype = function_pointer_type(f) pvalue = function_pointer_value(f) print ' if (strcmp("%s", (const char *)procName) == 0) {' % f.name print ' %s = (%s)procPtr;' % (pvalue, ptype) print ' return (__GLXextFuncPtr)&%s;' % (f.name,) print ' }'