X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glws.hpp;h=05654200f7d966d9f443b696a13c8ab8ffde68f6;hb=00e0021870c9bbba51376aa32554183e1c7859ba;hp=8f4a845e0207b95b5052a6b45fe6194800647215;hpb=818d47d1c34f6e23e42e846ada471d0124e38ebe;p=apitrace diff --git a/glws.hpp b/glws.hpp index 8f4a845..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; }; @@ -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;