]> git.cworth.org Git - apitrace/blobdiff - glretrace_wgl.cpp
Improve the indention in emacs just a bit.
[apitrace] / glretrace_wgl.cpp
index 7df2485e0737982327785dc8343b67727ed3dde2..34b48d013ccda904d2938b0dab52306f24880d00 100644 (file)
@@ -67,7 +67,7 @@ static void retrace_wglMakeCurrent(Trace::Call &call) {
     if (drawable && context) {
         glFlush();
         if (!double_buffer) {
-            frame_complete(call.no);
+            frame_complete(call);
         }
     }
     
@@ -98,7 +98,7 @@ static void retrace_wglSetPixelFormat(Trace::Call &call) {
 }
 
 static void retrace_wglSwapBuffers(Trace::Call &call) {
-    frame_complete(call.no);
+    frame_complete(call);
     if (double_buffer) {
         drawable->swapBuffers();
     } else {
@@ -116,8 +116,13 @@ static void retrace_wglShareLists(Trace::Call &call) {
     glws::Context *new_context =
         glws::createContext(old_context->visual, share_context);
     if (new_context) {
-        delete old_context;
+        if (context == old_context) {
+            glws::makeCurrent(drawable, new_context);
+        }
+
         context_map[hglrc2] = new_context;
+        
+        delete old_context;
     }
 }