diff options
author | José Fonseca <jose.r.fonseca@gmail.com> | 2011-02-20 11:25:25 +0000 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2011-02-22 07:15:58 +0000 |
commit | 68ec4122ceae159709f74ace0eb862595ed68d8a (patch) | |
tree | 9bb815973ff19f9747f2f6a12df0b8bde387ea81 /glxtrace.py | |
parent | eccec3ef1c54bc118acbc8f9c3ce7b2cdaa340c5 (diff) |
Use glproc.hpp also for both tracing and retracing.
Diffstat (limited to 'glxtrace.py')
-rw-r--r-- | glxtrace.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/glxtrace.py b/glxtrace.py index 2759319..bd86e5b 100644 --- a/glxtrace.py +++ b/glxtrace.py @@ -27,6 +27,8 @@ """GLX tracing generator.""" +from stdapi import API +from glapi import glapi from glxapi import glxapi from trace import Tracer @@ -34,15 +36,7 @@ from trace import Tracer class GlxTracer(Tracer): def get_function_address(self, function): - if function.name.startswith("glXGetProcAddress"): - return 'dlsym(RTLD_NEXT, "%s")' % (function.name,) - else: - print ' if (!pglXGetProcAddress) {' - print ' pglXGetProcAddress = (PglXGetProcAddress)dlsym(RTLD_NEXT, "glXGetProcAddress");' - print ' if (!pglXGetProcAddress)' - print ' Trace::Abort();' - print ' }' - return 'pglXGetProcAddress((const GLubyte *)"%s")' % (function.name,) + return '__%s' % (function.name,) def wrap_ret(self, function, instance): if function.name.startswith("glXGetProcAddress"): @@ -63,14 +57,17 @@ if __name__ == '__main__': print '#include <string.h>' print '#include <dlfcn.h>' print - print '#include "glimports.hpp"' - print print '#include "trace_write.hpp"' + print + print '#include "glproc.hpp"' print '#include "glsize.hpp"' print print 'extern "C" {' print + api = API() + api.add_api(glxapi) + api.add_api(glapi) tracer = GlxTracer() - tracer.trace_api(glxapi) + tracer.trace_api(api) print print '} /* extern "C" */' |