]> git.cworth.org Git - apitrace/blobdiff - retrace/glws.hpp
Update downloads link.
[apitrace] / retrace / glws.hpp
index 9afebf4b878a4b639863bb08d8bf12927fbd0495..c76e19321706a5c8a02fca80dfcce7774ad2ce6f 100644 (file)
 #define _GLWS_HPP_
 
 
+#include <assert.h>
+
 #include <vector>
+#include <set>
+#include <string>
 
 
 namespace glws {
@@ -46,9 +50,6 @@ enum Profile {
 };
 
 
-extern bool debug;
-
-
 bool
 checkExtension(const char *extName, const char *extString);
 
@@ -101,12 +102,14 @@ public:
     const Visual *visual;
     int width;
     int height;
+    bool pbuffer;
     bool visible;
 
-    Drawable(const Visual *vis, int w, int h) :
+    Drawable(const Visual *vis, int w, int h, bool pb) :
         visual(vis),
         width(w),
         height(h),
+        pbuffer(pb),
         visible(false)
     {}
 
@@ -120,6 +123,7 @@ public:
 
     virtual void
     show(void) {
+        assert(!pbuffer);
         visible = true;
     }
 
@@ -133,12 +137,18 @@ public:
     const Visual *visual;
     Profile profile;
     
+    std::set<std::string> extensions;
+
     Context(const Visual *vis, Profile prof) :
         visual(vis),
         profile(prof)
     {}
 
     virtual ~Context() {}
+
+    // Context must be current
+    bool
+    hasExtension(const char *extension);
 };
 
 
@@ -152,10 +162,10 @@ Visual *
 createVisual(bool doubleBuffer = false, Profile profile = PROFILE_COMPAT);
 
 Drawable *
-createDrawable(const Visual *visual, int width = 32, int height = 32);
+createDrawable(const Visual *visual, int width, int height, bool pbuffer = false);
 
 Context *
-createContext(const Visual *visual, Context *shareContext = 0, Profile profile = PROFILE_COMPAT);
+createContext(const Visual *visual, Context *shareContext = 0, Profile profile = PROFILE_COMPAT, bool debug = false);
 
 bool
 makeCurrent(Drawable *drawable, Context *context);