from gltrace import GlTracer
-from dispatch import function_pointer_type, function_pointer_value
from specs.stdapi import API
from specs.glapi import glapi
from specs.glxapi import glxapi
# The symbols visible in libGL.so can vary, so expose them all
return True
- def wrapRet(self, function, instance):
- GlTracer.wrapRet(self, function, instance)
-
- if function.name in ("glXGetProcAddress", "glXGetProcAddressARB"):
- print ' %s = __unwrap_proc_addr(procName, %s);' % (instance, instance)
+ getProcAddressFunctionNames = [
+ "glXGetProcAddress",
+ "glXGetProcAddressARB",
+ ]
if __name__ == '__main__':
print '#include "glproc.hpp"'
print '#include "glsize.hpp"'
print
- print 'static __GLXextFuncPtr __unwrap_proc_addr(const GLubyte * procName, __GLXextFuncPtr procPtr);'
- print
api = API()
api.addApi(glxapi)
api.addApi(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 ' os::log("apitrace: warning: unknown function \\"%s\\"\\n", (const char *)procName);'
- print ' return procPtr;'
- print '}'
- print
+ tracer.traceApi(api)
+
print r'''