]> git.notmuchmail.org Git - apitrace/blobdiff - glws.hpp
TODO: Fix typo in the description of the range specification.
[apitrace] / glws.hpp
index 12e53f3e8f93e5fd5f5c0f5de39eaa579ad48782..adabe14dd8038a415e8430b9c8a68f5deb0f7337 100644 (file)
--- a/glws.hpp
+++ b/glws.hpp
 #define _GLWS_HPP_
 
 
+#include <vector>
+
+
 namespace glws {
 
 
+enum Profile {
+    PROFILE_COMPAT,
+    PROFILE_ES1,
+    PROFILE_ES2,
+};
+
+
+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(T terminator = 0) {
+        add(terminator);
+    }
+
+    operator T * (void) {
+        return &attribs[0];
+    }
+
+    operator const T * (void) const {
+        return &attribs[0];
+    }
+};
+
+
 class Visual
 {
 public:
@@ -105,7 +151,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, Profile profile = PROFILE_COMPAT);
 
 bool
 makeCurrent(Drawable *drawable, Context *context);