]> git.cworth.org Git - apitrace/commitdiff
Fix wglDeleteContext tracing.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 9 Jul 2012 09:36:01 +0000 (10:36 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 9 Jul 2012 12:50:55 +0000 (13:50 +0100)
wglGetCurrentContext must be called before.

wrappers/wgltrace.py

index 52fd05182f62c3a664d68b378b4ea360591ceaad..b3a29e24584a0007afbc1f714ae1fec2050936e4 100644 (file)
@@ -40,6 +40,14 @@ class WglTracer(GlTracer):
     ]
 
     def traceFunctionImplBody(self, function):
+        if function.name == 'wglDeleteContext':
+            # Unlike other GL APIs like EGL or GLX, WGL will make the context
+            # inactive if it's currently the active context.
+            print '    if (_wglGetCurrentContext() == hglrc) {'
+            print '        gltrace::clearContext();'
+            print '    }'
+            print '    gltrace::destroyContext((uintptr_t)hglrc);'
+
         GlTracer.traceFunctionImplBody(self, function)
 
         if function.name == 'wglCreateContext':
@@ -54,14 +62,6 @@ class WglTracer(GlTracer):
             print '            gltrace::clearContext();'
             print '    }'
 
-        if function.name == 'wglDeleteContext':
-            # Unlike other GL APIs like EGL or GLX, WGL will make the context
-            # inactive if it's currently the active context.
-            print '    if (_wglGetCurrentContext() == hglrc) {'
-            print '        gltrace::clearContext();'
-            print '    }'
-            print '    gltrace::destroyContext((uintptr_t)hglrc);'
-
 
 if __name__ == '__main__':
     print