]> git.tdb.fi Git - libs/gl.git/blobdiff - source/ext_blend_minmax.cpp
Complete rewrite of extension handling
[libs/gl.git] / source / ext_blend_minmax.cpp
diff --git a/source/ext_blend_minmax.cpp b/source/ext_blend_minmax.cpp
new file mode 100644 (file)
index 0000000..225a05f
--- /dev/null
@@ -0,0 +1,26 @@
+#include "ext_blend_minmax.h"
+
+namespace Msp {
+namespace GL {
+
+PFNGLBLENDEQUATIONPROC glBlendEquation = 0;
+
+Extension::SupportLevel init_ext_blend_minmax()
+{
+       if(is_version_at_least(1, 2))
+       {
+               glBlendEquation = reinterpret_cast<PFNGLBLENDEQUATIONPROC>(get_proc_address("glBlendEquation"));
+               return Extension::CORE;
+       }
+       if(is_supported("GL_EXT_blend_minmax"))
+       {
+               glBlendEquation = reinterpret_cast<PFNGLBLENDEQUATIONPROC>(get_proc_address("glBlendEquationEXT"));
+               return Extension::EXTENSION;
+       }
+       return Extension::UNSUPPORTED;
+}
+
+Extension EXT_blend_minmax("GL_EXT_blend_minmax", init_ext_blend_minmax);
+
+} // namespace GL
+} // namespace Msp