]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/misc.cpp
Rearrange soucre files into subdirectories
[libs/gl.git] / source / core / misc.cpp
diff --git a/source/core/misc.cpp b/source/core/misc.cpp
new file mode 100644 (file)
index 0000000..39810be
--- /dev/null
@@ -0,0 +1,47 @@
+#include <msp/gl/extensions/arb_shader_objects.h>
+#include "misc.h"
+
+namespace Msp {
+namespace GL {
+
+void enable(GLenum state)
+{
+       glEnable(state);
+}
+
+void disable(GLenum state)
+{
+       glDisable(state);
+}
+
+void set(GLenum state, bool value)
+{
+       if(value)
+               enable(state);
+       else
+               disable(state);
+}
+
+int get_i(GLenum state)
+{
+       int data;
+       glGetIntegerv(state, &data);
+       return data;
+}
+
+int get_shader_i(unsigned id, GLenum state)
+{
+       int data;
+       glGetShaderiv(id, state, &data);
+       return data;
+}
+
+int get_program_i(unsigned id, GLenum state)
+{
+       int data;
+       glGetProgramiv(id, state, &data);
+       return data;
+}
+
+} // namespace GL
+} // namespace Msp