From ba9e3555503d911b07664b9ed4a5c5a02c325c6e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 18 Jan 2007 17:00:42 +0000 Subject: [PATCH] Added support for stencil GL_INCR_WRAP and GL_DECR_WRAP operations --- include/osg/Stencil | 10 +++++++++- src/osgPlugins/osg/Stencil.cpp | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/osg/Stencil b/include/osg/Stencil index 5fd8c9764..28dd60e4a 100644 --- a/include/osg/Stencil +++ b/include/osg/Stencil @@ -18,6 +18,12 @@ namespace osg { +#ifndef GL_INCR_WRAP +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#endif + + /** Encapsulate OpenGL glStencilFunc/Op/Mask functions. */ class OSG_EXPORT Stencil : public StateAttribute @@ -102,7 +108,9 @@ class OSG_EXPORT Stencil : public StateAttribute REPLACE = GL_REPLACE, INCR = GL_INCR, DECR = GL_DECR, - INVERT = GL_INVERT + INVERT = GL_INVERT, + INCR_WRAP = GL_INCR_WRAP, + DECR_WRAP = GL_DECR_WRAP }; /** set the operations to apply when the various stencil and depth diff --git a/src/osgPlugins/osg/Stencil.cpp b/src/osgPlugins/osg/Stencil.cpp index 02a75c2b8..4c5cedd54 100644 --- a/src/osgPlugins/osg/Stencil.cpp +++ b/src/osgPlugins/osg/Stencil.cpp @@ -158,6 +158,8 @@ bool Stencil_matchOperationStr(const char* str,Stencil::Operation& op) else if (strcmp(str,"INCR")==0) op = Stencil::INCR; else if (strcmp(str,"DECR")==0) op = Stencil::DECR; else if (strcmp(str,"INVERT")==0) op = Stencil::INVERT; + else if (strcmp(str,"INCR_WRAP")==0) op = Stencil::INCR_WRAP; + else if (strcmp(str,"DECR_WRAP")==0) op = Stencil::DECR_WRAP; else return false; return true; } @@ -172,6 +174,8 @@ const char* Stencil_getOperationStr(Stencil::Operation op) case(Stencil::INCR): return "INCR"; case(Stencil::DECR): return "DECR"; case(Stencil::INVERT): return "INVERT"; + case(Stencil::INCR_WRAP): return "INCR_WRAP"; + case(Stencil::DECR_WRAP): return "DECR_WRAP"; } return ""; }