X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glws.hpp;h=47fdc7f40729f24e4a7905a2a914b3877ffbe8e3;hb=93f0e3f5b7fc212bc993af407dacac24cdab5210;hp=12e53f3e8f93e5fd5f5c0f5de39eaa579ad48782;hpb=b87c229d14519fd912418cec3e3747557a055b31;p=apitrace diff --git a/glws.hpp b/glws.hpp index 12e53f3..47fdc7f 100644 --- a/glws.hpp +++ b/glws.hpp @@ -31,9 +31,48 @@ #define _GLWS_HPP_ +#include + + namespace glws { +extern bool debug; + + +bool +checkExtension(const char *extName, const char *extString); + + +template< class T > +class Attributes { +protected: + std::vector attribs; + +public: + void add(T param) { + attribs.push_back(param); + } + + void add(T pname, T pvalue) { + add(pname); + add(pvalue); + } + + void end(void) { + add(0); + } + + operator T * (void) { + return &attribs[0]; + } + + operator const T * (void) const { + return &attribs[0]; + } +}; + + class Visual { public: @@ -105,7 +144,7 @@ Drawable * createDrawable(const Visual *visual, int width = 32, int height = 32); Context * -createContext(const Visual *visual, Context *shareContext = NULL); +createContext(const Visual *visual, Context *shareContext = 0); bool makeCurrent(Drawable *drawable, Context *context);