12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #ifndef StencilStateManager_hpp
- #define StencilStateManager_hpp
- #include "base/ccConfig.h"
- #include "platform/CCPlatformMacros.h"
- #include "platform/CCGL.h"
- NS_CC_BEGIN
- class CC_DLL StencilStateManager
- {
- public:
- StencilStateManager();
- void onBeforeVisit();
- void onAfterDrawStencil();
- void onAfterVisit();
- void setAlphaThreshold(GLfloat alphaThreshold);
- void setInverted(bool inverted);
- bool isInverted()const;
- GLfloat getAlphaThreshold()const;
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(StencilStateManager);
- static GLint s_layer;
-
- void drawFullScreenQuadClearStencil();
-
-
- GLfloat _alphaThreshold;
- bool _inverted;
-
- GLboolean _currentStencilEnabled;
- GLuint _currentStencilWriteMask;
- GLenum _currentStencilFunc;
- GLint _currentStencilRef;
- GLuint _currentStencilValueMask;
- GLenum _currentStencilFail;
- GLenum _currentStencilPassDepthFail;
- GLenum _currentStencilPassDepthPass;
- GLboolean _currentDepthWriteMask;
-
- GLboolean _currentAlphaTestEnabled;
- GLenum _currentAlphaTestFunc;
- GLclampf _currentAlphaTestRef;
-
- GLint _mask_layer_le;
- };
- NS_CC_END
- #endif
|