Skip to content

Commit d97809d

Browse files
paulhouxandrewfb
authored andcommitted
Sets proper initial states for stencil func and op.
1 parent 7631012 commit d97809d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/cinder/gl/Context.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ Context::Context( const std::shared_ptr<PlatformData> &platformData )
9393
// initial state for stencil mask is all bits enabled
9494
mStencilMaskStack.emplace_back( 0xFF, 0xFF );
9595

96+
// initial state for stencil op is GL_KEEP, GL_KEEP, GL_KEEP
97+
mStencilOpFrontStack.emplace_back(GL_KEEP, GL_KEEP, GL_KEEP);
98+
mStencilOpBackStack.emplace_back(GL_KEEP, GL_KEEP, GL_KEEP);
99+
100+
// initial state for stencil func is GL_ALWAYS, 0, 0xFF
101+
mStencilFuncFrontStack.emplace_back(GL_ALWAYS, 0, 0xFF);
102+
mStencilFuncBackStack.emplace_back(GL_ALWAYS, 0, 0xFF);
103+
96104
// initial state for depth mask is enabled
97105
mBoolStateStack[GL_DEPTH_WRITEMASK] = vector<GLboolean>();
98106
mBoolStateStack[GL_DEPTH_WRITEMASK].push_back( GL_TRUE );

0 commit comments

Comments
 (0)