]> git.cworth.org Git - apitrace/blobdiff - glretrace.py
Cleanup/comment/format code.
[apitrace] / glretrace.py
index 6de28828a7f9312b13b4b11c26d90953ceffb0bb..a6414e41aeee5c1fef060c9eb99cb80bd9b6cc60 100644 (file)
@@ -37,8 +37,8 @@ class GlRetracer(Retracer):
 
     table_name = 'glretrace::gl_callbacks'
 
-    def retrace_function(self, function):
-        Retracer.retrace_function(self, function)
+    def retraceFunction(self, function):
+        Retracer.retraceFunction(self, function)
 
     array_pointer_function_names = set((
         "glVertexPointer",
@@ -165,7 +165,7 @@ class GlRetracer(Retracer):
         'glUnmapNamedBufferEXT',
     ])
 
-    def retrace_function_body(self, function):
+    def retraceFunctionBody(self, function):
         is_array_pointer = function.name in self.array_pointer_function_names
         is_draw_array = function.name in self.draw_array_function_names
         is_draw_elements = function.name in self.draw_elements_function_names
@@ -178,14 +178,14 @@ class GlRetracer(Retracer):
                 print '        GLint __array_buffer = 0;'
                 print '        glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &__array_buffer);'
                 print '        if (!__array_buffer) {'
-                self.fail_function(function)
+                self.failFunction(function)
                 print '        }'
 
             if is_draw_elements:
                 print '        GLint __element_array_buffer = 0;'
                 print '        glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &__element_array_buffer);'
                 print '        if (!__element_array_buffer) {'
-                self.fail_function(function)
+                self.failFunction(function)
                 print '        }'
             
             print '    }'
@@ -213,7 +213,7 @@ class GlRetracer(Retracer):
             print '    glretrace::frame_complete(call);'
             return
 
-        Retracer.retrace_function_body(self, function)
+        Retracer.retraceFunctionBody(self, function)
 
         # Post-snapshots
         if function.name in ('glFlush', 'glFinish'):
@@ -226,7 +226,7 @@ class GlRetracer(Retracer):
             print '    }'
 
 
-    def call_function(self, function):
+    def invokeFunction(self, function):
         # Infer the drawable size from GL calls
         if function.name == "glViewport":
             print '    glretrace::updateDrawable(x + width, y + height);'
@@ -241,7 +241,7 @@ class GlRetracer(Retracer):
         if function.name == 'memcpy':
             print '    if (!dest || !src || !n) return;'
         
-        Retracer.call_function(self, function)
+        Retracer.invokeFunction(self, function)
 
         # Error checking
         if function.name == "glBegin":
@@ -348,20 +348,20 @@ class GlRetracer(Retracer):
                 print r'            retrace::delRegionByPointer(ptr);'
                 print r'        }'
 
-    def extract_arg(self, function, arg, arg_type, lvalue, rvalue):
+    def extractArg(self, function, arg, arg_type, lvalue, rvalue):
         if function.name in self.array_pointer_function_names and arg.name == 'pointer':
             print '    %s = static_cast<%s>(retrace::toPointer(%s, true));' % (lvalue, arg_type, rvalue)
             return
 
         if function.name in self.draw_elements_function_names and arg.name == 'indices' or\
            function.name in self.draw_indirect_function_names and arg.name == 'indirect':
-            self.extract_opaque_arg(function, arg, arg_type, lvalue, rvalue)
+            self.extractOpaqueArg(function, arg, arg_type, lvalue, rvalue)
             return
 
         # Handle pointer with offsets into the current pack pixel buffer
         # object.
         if function.name in self.pack_function_names and arg.output:
-            self.extract_opaque_arg(function, arg, arg_type, lvalue, rvalue)
+            self.extractOpaqueArg(function, arg, arg_type, lvalue, rvalue)
             return
 
         if arg.type is glapi.GLlocation \
@@ -373,7 +373,7 @@ class GlRetracer(Retracer):
            and 'programObj' not in [arg.name for arg in function.args]:
             print '    GLhandleARB programObj = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);'
 
-        Retracer.extract_arg(self, function, arg, arg_type, lvalue, rvalue)
+        Retracer.extractArg(self, function, arg, arg_type, lvalue, rvalue)
 
         # Don't try to use more samples than the implementation supports
         if arg.name == 'samples':
@@ -396,6 +396,6 @@ if __name__ == '__main__':
 
 '''
     api = glapi.glapi
-    api.add_api(glesapi.glesapi)
+    api.addApi(glesapi.glesapi)
     retracer = GlRetracer()
-    retracer.retrace_api(api)
+    retracer.retraceApi(api)