]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/stenciltest_backend.cpp
Move all OpenGL-specific code to a separate directory
[libs/gl.git] / source / backends / opengl / stenciltest_backend.cpp
diff --git a/source/backends/opengl/stenciltest_backend.cpp b/source/backends/opengl/stenciltest_backend.cpp
new file mode 100644 (file)
index 0000000..258bf9b
--- /dev/null
@@ -0,0 +1,27 @@
+#include "gl.h"
+#include "stenciltest.h"
+#include "stenciltest_backend.h"
+
+using namespace std;
+
+namespace Msp {
+namespace GL {
+
+unsigned get_gl_stencil_op(StencilOp op)
+{
+       switch(op)
+       {
+       case KEEP: return GL_KEEP;
+       case SET_ZERO: return GL_ZERO;
+       case REPLACE: return GL_REPLACE;
+       case INCR: return GL_INCR;
+       case DECR: return GL_DECR;
+       case INVERT: return GL_INVERT;
+       case INCR_WRAP: return GL_INCR_WRAP;
+       case DECR_WRAP: return GL_DECR_WRAP;
+       default: throw invalid_argument("get_gl_stencil_op");
+       }
+}
+
+} // namespace GL
+} // namespace Msp