]> git.notmuchmail.org Git - apitrace/commitdiff
Move glFlush specific code to the retrace function.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 4 May 2011 23:31:01 +0000 (00:31 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 4 May 2011 23:31:01 +0000 (00:31 +0100)
glretrace.hpp
glretrace.py
glretrace_main.cpp

index 9fa7ae733a91ab1feb5c1c8f2eb5d723b1eab1ca..5fce5dc5663df00a9e0e2fbc23c1c89d6e968ca1 100644 (file)
@@ -59,6 +59,8 @@ extern unsigned dump_state;
 void
 checkGlError(int callIdx = -1);
 
+void frame_complete(unsigned call_no);
+
 void state_dump(std::ostream &os);
 
 
index 72931b51bc4c9dde53638fb37231d5d6a586f0df..2cb17cdb299b85aa8290587109c0247e7b7eb5ca 100644 (file)
@@ -153,6 +153,11 @@ class GlRetracer(Retracer):
             # glGetError is not allowed inside glBegin/glEnd
             print '    glretrace::checkGlError(call.no);'
 
+        if function.name == 'glFlush':
+            print '    if (!glretrace::double_buffer) {'
+            print '        glretrace::frame_complete(call.no);'
+            print '    }'
+
     def extract_arg(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>(%s.blob());' % (lvalue, arg_type, rvalue)
index a18d1cd6a472a56cd3858c87126e65f981cfd680..922ec303b01e0f72e7976a3aaa5d90ef45868baa 100644 (file)
@@ -115,7 +115,7 @@ static void snapshot(Image::Image &image) {
 }
 
 
-static void frame_complete(unsigned call_no) {
+void frame_complete(unsigned call_no) {
     ++frame;
     
     if (snapshot_prefix || compare_prefix) {
@@ -182,13 +182,6 @@ static void display(void) {
             skipCall = true;
         }
 
-        if (name == "glFlush") {
-            glFlush();
-            if (!double_buffer) {
-                frame_complete(call->no);
-            }
-        }
-
         if (!skipCall) {
             retrace::retrace_call(*call);
         }