]> git.cworth.org Git - apitrace/blobdiff - retrace/glretrace_wgl.cpp
trace: Unwrap all args before serializing them.
[apitrace] / retrace / glretrace_wgl.cpp
index 8fc9fe667ace5f4cd16f2f8d6b1b4df5cb47fae5..abcf068a057056f88bdefbe1d8c002bd2e9e0459 100644 (file)
@@ -100,8 +100,11 @@ static void retrace_wglSwapBuffers(trace::Call &call) {
     if (retrace::doubleBuffer) {
         if (drawable) {
             drawable->swapBuffers();
-        } else if (currentContext) {
-            currentContext->drawable->swapBuffers();
+        } else {
+            glretrace::Context *currentContext = glretrace::getCurrentContext();
+            if (currentContext) {
+                currentContext->drawable->swapBuffers();
+            }
         }
     } else {
         glFlush();
@@ -117,6 +120,7 @@ static void retrace_wglShareLists(trace::Call &call) {
 
     Context *new_context = glretrace::createContext(share_context);
     if (new_context) {
+        glretrace::Context *currentContext = glretrace::getCurrentContext();
         if (currentContext == old_context) {
             glretrace::makeCurrent(call, currentContext->drawable, new_context);
         }