Added support for stencil GL_INCR_WRAP and GL_DECR_WRAP operations
This commit is contained in:
parent
d60d04c8c4
commit
ba9e355550
@ -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
|
||||
|
@ -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 "";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user