]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/features.cpp
Reduce coupling between the GLSL compiler and the graphics engine
[libs/gl.git] / source / glsl / features.cpp
diff --git a/source/glsl/features.cpp b/source/glsl/features.cpp
new file mode 100644 (file)
index 0000000..d1c8101
--- /dev/null
@@ -0,0 +1,37 @@
+#include <msp/gl/extensions/arb_explicit_attrib_location.h>
+#include <msp/gl/extensions/arb_gpu_shader5.h>
+#include <msp/gl/extensions/arb_uniform_buffer_object.h>
+#include <msp/gl/extensions/ext_gpu_shader4.h>
+#include <msp/gl/extensions/ext_texture_array.h>
+#include "features.h"
+
+namespace Msp {
+namespace GL {
+namespace SL {
+
+Features::Features():
+       gl_api(OPENGL),
+       arb_explicit_attrib_location(false),
+       arb_gpu_shader5(false),
+       arb_uniform_buffer_object(false),
+       ext_gpu_shader4(false),
+       ext_texture_array(false)
+{ }
+
+Features Features::from_context()
+{
+       Features features;
+       features.gl_api = get_gl_api();
+       features.glsl_version = get_glsl_version();
+       features.arb_explicit_attrib_location = ARB_explicit_attrib_location;
+       features.arb_gpu_shader5 = ARB_gpu_shader5;
+       //features.arb_texture_cube_map_array = ARB_texture_cube_map_array;
+       features.arb_uniform_buffer_object = ARB_uniform_buffer_object;
+       features.ext_gpu_shader4 = EXT_gpu_shader4;
+       features.ext_texture_array = EXT_texture_array;
+       return features;
+}
+
+} // namespace SL
+} // namespace GL
+} // namespace Msp