]> git.cworth.org Git - apitrace/blobdiff - glxtrace.py
More compact struct representation.
[apitrace] / glxtrace.py
index 1874f9415dd6942c82382e95763fe440745a59a2..14aca2a969c707384c7d5dca467ddd54d83d5ad5 100644 (file)
@@ -1,6 +1,6 @@
 ##########################################################################
 #
-# Copyright 2008-2009 VMware, Inc.
+# Copyright 2008-2010 VMware, Inc.
 # All Rights Reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 ##########################################################################/
 
 
-from base import *
-from glapi import glapi
-import trace
+from glxapi import glxapi
+from trace import Tracer
 
 
-glxapi = API("GLX")
-
-PROC = Opaque("__GLXextFuncPtr")
-
-glxapi.add_functions(glapi.functions)
-glxapi.add_functions([
-    Function(PROC, "glXGetProcAddress", [(Alias("const GLubyte *", String), "procName")])
-])
-
-
-class GlxTracer(trace.Tracer):
+class GlxTracer(Tracer):
 
     def get_function_address(self, function):
-        if function.name == "glXGetProcAddress":
+        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 '            Log::Abort();'
+            print '            Trace::Abort();'
             print '    }'
             return 'pglXGetProcAddress((const GLubyte *)"%s")' % (function.name,)
 
     def wrap_ret(self, function, instance):
-        if function.name == "glXGetProcAddress":
+        if function.name.startswith("glXGetProcAddress"):
             print '    if (%s) {' % instance
             for f in glxapi.functions:
                 ptype = self.function_pointer_type(f)
@@ -72,12 +61,12 @@ if __name__ == '__main__':
     print '#include <dlfcn.h>'
     print '#include <X11/Xlib.h>'
     print '#include <GL/gl.h>'
-    print '#include <GL/glext.h>'
+    print '#include "glext.h"'
     print '#include <GL/glx.h>'
-    print '#include <GL/glxext.h>'
+    print '#include "glxext.h"'
     print
-    print '#include "log.hpp"'
-    print '#include "glhelpers.hpp"'
+    print '#include "trace_write.hpp"'
+    print '#include "glsize.hpp"'
     print
     print 'extern "C" {'
     print