X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glws.hpp;h=05654200f7d966d9f443b696a13c8ab8ffde68f6;hb=f562f318ddee6da2041696887e2195fc3c96d740;hp=7f4b52d9db9526bc9e8d8b78321d86be6751b4a8;hpb=ce6bcdd4395c9efec37a26f6c1caf8944d75f6d0;p=apitrace diff --git a/glws.hpp b/glws.hpp index 7f4b52d..0565420 100644 --- 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; }; @@ -92,10 +101,10 @@ public: 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;