]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/stenciltest.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / core / stenciltest.cpp
index 57a191cfad95f83620b5ac1f35487adf9d49cc2f..4c63497759717e2dd3d1c241421a138c9e3bfd45 100644 (file)
@@ -1,6 +1,5 @@
 #include <stdexcept>
 #include <msp/strings/format.h>
-#include "gl.h"
 #include "stenciltest.h"
 
 using namespace std;
@@ -8,16 +7,6 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
-StencilTest::StencilTest():
-       enabled(false),
-       compare(ALWAYS),
-       stencil_fail_op(KEEP),
-       depth_fail_op(KEEP),
-       depth_pass_op(KEEP),
-       reference(0)
-{ }
-
-
 StencilTest::Loader::Loader(StencilTest &st):
        ObjectLoader<StencilTest>(st)
 {
@@ -40,22 +29,6 @@ void StencilTest::Loader::actions(StencilOp sf, StencilOp df, StencilOp dp)
 }
 
 
-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");
-       }
-}
-
 void operator>>(const LexicalConverter &conv, StencilOp &op)
 {
        const string &str = conv.get();
@@ -65,10 +38,10 @@ void operator>>(const LexicalConverter &conv, StencilOp &op)
                op = SET_ZERO;
        else if(str=="REPLACE")
                op = REPLACE;
-       else if(str=="INCR")
-               op = INCR;
-       else if(str=="DECR")
-               op = DECR;
+       else if(str=="INCR_CLAMP")
+               op = INCR_CLAMP;
+       else if(str=="DECR_CLAMP")
+               op = DECR_CLAMP;
        else if(str=="INVERT")
                op = INVERT;
        else if(str=="INCR_WRAP")
@@ -86,8 +59,8 @@ void operator<<(LexicalConverter &conv, StencilOp op)
        case KEEP: conv.result("KEEP"); break;
        case SET_ZERO: conv.result("SET_ZERO"); break;
        case REPLACE: conv.result("REPLACE"); break;
-       case INCR: conv.result("INCR"); break;
-       case DECR: conv.result("DECR"); break;
+       case INCR_CLAMP: conv.result("INCR_CLAMP"); break;
+       case DECR_CLAMP: conv.result("DECR_CLAMP"); break;
        case INVERT: conv.result("INVERT"); break;
        case INCR_WRAP: conv.result("INCR_WRAP"); break;
        case DECR_WRAP: conv.result("DECR_WRAP"); break;