]> git.cworth.org Git - apitrace/blobdiff - wrappers/wgltrace.py
Fix build. Add copyright header to new files.
[apitrace] / wrappers / wgltrace.py
index f7625c6d895622a98d4470f4d35f1aac01376d7e..52fd05182f62c3a664d68b378b4ea360591ceaad 100644 (file)
@@ -55,12 +55,12 @@ class WglTracer(GlTracer):
             print '    }'
 
         if function.name == 'wglDeleteContext':
-            print '    gltrace::Context *current_ctx = gltrace::getContext();'
             # Unlike other GL APIs like EGL or GLX, WGL will make the context
             # inactive if it's currently the active context.
-            print '    if (current_ctx == (uintptr_t)hglrc)'
+            print '    if (_wglGetCurrentContext() == hglrc) {'
             print '        gltrace::clearContext();'
-            print '    gltrace::destroyContext((uintptr_t)ctx);'
+            print '    }'
+            print '    gltrace::destroyContext((uintptr_t)hglrc);'
 
 
 if __name__ == '__main__':