]> git.cworth.org Git - apitrace/blobdiff - glws.hpp
Add support for GL_APPLE_flush_render
[apitrace] / glws.hpp
index 8f4a845e0207b95b5052a6b45fe6194800647215..05654200f7d966d9f443b696a13c8ab8ffde68f6 100644 (file)
--- a/glws.hpp
+++ b/glws.hpp
@@ -51,21 +51,30 @@ class Drawable
 {
 public:
     const Visual *visual;
-    unsigned width;
-    unsigned height;
-
-    Drawable(const Visual *vis) :
-        visual(vis)
+    int width;
+    int height;
+    bool visible;
+
+    Drawable(const Visual *vis, int w, int h) :
+        visual(vis),
+        width(w),
+        height(h),
+        visible(false)
     {}
 
     virtual ~Drawable() {}
     
     virtual void
-    resize(unsigned w, unsigned h) {
+    resize(int w, int h) {
         width = w;
         height = h;
     }
 
+    virtual void
+    show(void) {
+        visible = true;
+    }
+
     virtual void swapBuffers(void) = 0;
 };
 
@@ -86,25 +95,16 @@ public:
 class WindowSystem
 {
 public:
-    Drawable *currentDrawable;
-    Context *currentContext;
-
-
-    inline WindowSystem() :
-        currentDrawable(NULL),
-        currentContext(NULL)
-    {}
-
     virtual ~WindowSystem() {}
 
     virtual Visual *
-    createVisual(bool doubleBuffer=false) = 0;
+    createVisual(bool doubleBuffer = false) = 0;
     
     virtual Drawable *
-    createDrawable(const Visual *visual) = 0;
+    createDrawable(const Visual *visual, int width = 32, int height = 32) = 0;
 
     virtual Context *
-    createContext(const Visual *visual) = 0;
+    createContext(const Visual *visual, Context *shareContext = NULL) = 0;
     
     virtual bool
     makeCurrent(Drawable *drawable, Context *context) = 0;