]> git.cworth.org Git - apitrace/blobdiff - retrace/glws.hpp
retrace: Implement glxCopySubBufferMESA
[apitrace] / retrace / glws.hpp
index 05903a7b55281b96b6d00058c844fe551a2b9f7e..a8b6844d117cdef527909dd47c889cf3361574a4 100644 (file)
 #define _GLWS_HPP_
 
 
+#include <assert.h>
+
 #include <vector>
+#include <set>
+#include <string>
 
 
 namespace glws {
@@ -98,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)
     {}
 
@@ -117,9 +123,12 @@ public:
 
     virtual void
     show(void) {
+        assert(!pbuffer);
         visible = true;
     }
 
+    virtual void copySubBuffer(int x, int y, int width, int height) = 0;
+
     virtual void swapBuffers(void) = 0;
 };
 
@@ -130,12 +139,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);
 };
 
 
@@ -149,7 +164,7 @@ 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, bool debug = false);