summaryrefslogtreecommitdiff
path: root/glws.hpp
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2011-10-09 16:16:18 +0100
committerJosé Fonseca <jose.r.fonseca@gmail.com>2011-10-09 16:16:18 +0100
commit93f0e3f5b7fc212bc993af407dacac24cdab5210 (patch)
tree597d5b764428be93e7eac54fb99fa48484e9607a /glws.hpp
parentb87c229d14519fd912418cec3e3747557a055b31 (diff)
Create contexts with DEBUG_BIT when not benchmarking.
Diffstat (limited to 'glws.hpp')
-rw-r--r--glws.hpp41
1 files changed, 40 insertions, 1 deletions
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 <vector>
+
+
namespace glws {
+extern bool debug;
+
+
+bool
+checkExtension(const char *extName, const char *extString);
+
+
+template< class T >
+class Attributes {
+protected:
+ std::vector<T> 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);