From: José Fonseca Date: Mon, 9 Jul 2012 09:36:01 +0000 (+0100) Subject: Fix wglDeleteContext tracing. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=41b89a562f349822ede19c1d18a5e7371a24a65e;p=apitrace Fix wglDeleteContext tracing. wglGetCurrentContext must be called before. --- diff --git a/wrappers/wgltrace.py b/wrappers/wgltrace.py index 52fd051..b3a29e2 100644 --- a/wrappers/wgltrace.py +++ b/wrappers/wgltrace.py @@ -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