]> git.cworth.org Git - apitrace/blobdiff - glws_glx.cpp
Add another enum.
[apitrace] / glws_glx.cpp
index 5a570e2b4f6695e2752a8593039a4113e09e3ae9..64f8ce129a41089a75f702c39b6f0359533171d8 100644 (file)
@@ -23,6 +23,9 @@
  *
  **************************************************************************/
 
+#include <stdlib.h>
+#include <iostream>
+
 #include "glimports.hpp"
 #include "glws.hpp"
 
@@ -63,8 +66,10 @@ public:
     
     void
     resize(unsigned w, unsigned h) {
+        glXWaitGL();
         Drawable::resize(w, h);
         XResizeWindow(display, window, w, h);
+        glXWaitX();
     }
 
     void swapBuffers(void) {
@@ -100,6 +105,10 @@ private:
 public:
     GlxWindowSystem() {
         display = XOpenDisplay(NULL);
+       if (!display) {
+            std::cerr << "error: unable to open display " << XDisplayName(NULL) << "\n";
+            exit(1);
+        }
         screen = DefaultScreen(display);
     }
 
@@ -115,6 +124,7 @@ public:
             GLX_GREEN_SIZE, 1,
             GLX_BLUE_SIZE, 1,
             GLX_DEPTH_SIZE, 1,
+            GLX_STENCIL_SIZE, 1,
             None
         };
 
@@ -125,6 +135,7 @@ public:
             GLX_BLUE_SIZE, 1,
             GLX_DOUBLEBUFFER,
             GLX_DEPTH_SIZE, 1,
+            GLX_STENCIL_SIZE, 1,
             None
         };
 
@@ -194,7 +205,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);