]> git.tdb.fi Git - libs/gl.git/blobdiff - source/extension.h
Add support for detecting extensions
[libs/gl.git] / source / extension.h
diff --git a/source/extension.h b/source/extension.h
new file mode 100644 (file)
index 0000000..d6eb75f
--- /dev/null
@@ -0,0 +1,37 @@
+/* $Id$
+
+This file is part of libmspgl
+Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
+#ifndef MSP_GL_EXTENSION_H_
+#define MSP_GL_EXTENSION_H_
+
+#include <msp/core/except.h>
+
+namespace Msp {
+namespace GL {
+
+typedef void ExtFunc();
+
+/**
+Indicates whether an extension is supported.  If this returns true, the
+functions of that extension are safe to use.
+*/
+bool is_supported(const std::string &);
+
+/**
+Checks that an extension is supported and throws if it isn't.
+*/
+void require_extension(const std::string &);
+
+/**
+Returns the address of an extension function.
+*/
+ExtFunc *get_proc_address(const std::string &);
+
+} // namespace GL
+} // namespace Msp
+
+#endif