]> git.cworth.org Git - apitrace/blobdiff - glws_glx.cpp
Synchronize X and GL on windows resizes.
[apitrace] / glws_glx.cpp
index 5a570e2b4f6695e2752a8593039a4113e09e3ae9..661e77db4ae1b0a874329fd909126baa58433ade 100644 (file)
@@ -63,8 +63,10 @@ public:
     
     void
     resize(unsigned w, unsigned h) {
+        glXWaitGL();
         Drawable::resize(w, h);
         XResizeWindow(display, window, w, h);
+        glXWaitX();
     }
 
     void swapBuffers(void) {
@@ -115,6 +117,7 @@ public:
             GLX_GREEN_SIZE, 1,
             GLX_BLUE_SIZE, 1,
             GLX_DEPTH_SIZE, 1,
+            GLX_STENCIL_SIZE, 1,
             None
         };
 
@@ -125,6 +128,7 @@ public:
             GLX_BLUE_SIZE, 1,
             GLX_DOUBLEBUFFER,
             GLX_DEPTH_SIZE, 1,
+            GLX_STENCIL_SIZE, 1,
             None
         };
 
@@ -194,7 +198,7 @@ public:
     makeCurrent(Drawable *drawable, Context *context)
     {
         if (!drawable || !context) {
-            return glXMakeCurrent(display, NULL, NULL);
+            return glXMakeCurrent(display, None, NULL);
         } else {
             GlxDrawable *glxDrawable = dynamic_cast<GlxDrawable *>(drawable);
             GlxContext *glxContext = dynamic_cast<GlxContext *>(context);