]> git.cworth.org Git - apitrace/blobdiff - glws_glx.cpp
Merge pull request #17 from mysticbob/master
[apitrace] / glws_glx.cpp
index 67a88290b7988804bb0f3c4c16c30fc083d6451a..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);
     }