Lines Matching refs:stencilOp
115 class StencilOp
137 StencilOp (Type type_, GLenum stencilTest_ = GL_ALWAYS, int stencil_ = 0, GLenum depthTest_ = GL_ALWAYS, float depth_ = 1.0f, GLenum sFail_ = GL_KEEP, GLenum dFail_ = GL_KEEP, GLenum dPass_ = GL_KEEP)
150 static StencilOp clearStencil (int stencil)
152 StencilOp op(TYPE_CLEAR_STENCIL);
157 static StencilOp clearDepth (float depth)
159 StencilOp op(TYPE_CLEAR_DEPTH);
164 static StencilOp quad (GLenum stencilTest, int stencil, GLenum depthTest, float depth, GLenum sFail, GLenum dFail, GLenum dPass)
166 return StencilOp(TYPE_QUAD, stencilTest, stencil, depthTest, depth, sFail, dFail, dPass);
180 virtual void genOps (vector<StencilOp>& dst, int stencilBits, int depthBits, int targetStencil) = DE_NULL;
183 void executeOps (sglr::Context& context, const IVec4& cell, const vector<StencilOp>& ops);
208 void StencilCase::executeOps (sglr::Context& context, const IVec4& cell, const vector<StencilOp>& ops)
218 for (vector<StencilOp>::const_iterator i = ops.begin(); i != ops.end(); i++)
220 const StencilOp& op = *i;
224 case StencilOp::TYPE_CLEAR_DEPTH:
232 case StencilOp::TYPE_CLEAR_STENCIL:
240 case StencilOp::TYPE_QUAD:
245 context.stencilOp(op.sFail, op.dFail, op.dPass);
263 context.stencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
304 vector<vector<StencilOp> > ops(numStencilValues+2);
390 typedef void (*GenStencilOpsFunc) (vector<StencilOp>& dst, int stencilBits, int depthBits, int targetStencil);
401 void genOps (vector<StencilOp>& dst, int stencilBits, int depthBits, int targetStencil)
415 static void genOps (vector<StencilOp>& dst, int stencilBits, int depthBits, int targetStencil) \
428 dst.push_back(StencilOp::clearStencil(targetStencil | ~mask));
434 dst.push_back(StencilOp::quad(GL_NEVER, targetStencil, GL_ALWAYS, 0.0f, GL_REPLACE, GL_KEEP, GL_KEEP));
438 dst.push_back(StencilOp::clearDepth(0.0f));
439 dst.push_back(StencilOp::quad(GL_ALWAYS, targetStencil, GL_LESS, 0.5f, GL_KEEP, GL_REPLACE, GL_KEEP));
443 dst.push_back(StencilOp::quad(GL_ALWAYS, targetStencil, GL_LESS, 0.0f, GL_KEEP, GL_KEEP, GL_REPLACE));
451 dst.push_back(StencilOp::clearStencil(targetStencil-1));
452 dst.push_back(StencilOp::quad(GL_EQUAL, targetStencil, GL_ALWAYS, 0.0f, GL_INCR, GL_KEEP, GL_KEEP));
455 dst.push_back(StencilOp::clearStencil(targetStencil));
462 dst.push_back(StencilOp::clearStencil(targetStencil+1));
463 dst.push_back(StencilOp::quad(GL_EQUAL, targetStencil, GL_ALWAYS, 0.0f, GL_DECR, GL_KEEP, GL_KEEP));
466 dst.push_back(StencilOp::clearStencil(targetStencil));
471 dst.push_back(StencilOp::clearStencil((targetStencil-1)&maxStencil));
472 dst.push_back(StencilOp::quad(GL_EQUAL, targetStencil, GL_ALWAYS, 0.0f, GL_INCR_WRAP, GL_KEEP, GL_KEEP));
477 dst.push_back(StencilOp::clearStencil((targetStencil+1)&maxStencil));
478 dst.push_back(StencilOp::quad(GL_EQUAL, targetStencil, GL_ALWAYS, 0.0f, GL_DECR_WRAP, GL_KEEP, GL_KEEP));
484 dst.push_back(StencilOp::clearStencil(targetStencil));
485 dst.push_back(StencilOp::quad(GL_NOTEQUAL, targetStencil, GL_ALWAYS, 0.0f, GL_ZERO, GL_KEEP, GL_KEEP));
486 dst.push_back(StencilOp::quad(GL_EQUAL, targetStencil, GL_ALWAYS, 0.0f, GL_REPLACE, GL_KEEP, GL_KEEP));
491 dst.push_back(StencilOp::clearStencil((~targetStencil)&mask));
492 dst.push_back(StencilOp::quad(GL_EQUAL, targetStencil, GL_ALWAYS, 0.0f, GL_INVERT, GL_KEEP, GL_KEEP));
500 dst.push_back(StencilOp::clearStencil(inv));
501 dst.push_back(StencilOp::quad(GL_EQUAL, inv, GL_ALWAYS, 0.0f, GL_KEEP, GL_KEEP, GL_INVERT));
502 dst.push_back(StencilOp::quad(GL_EQUAL, inv, GL_ALWAYS, 0.0f, GL_KEEP, GL_KEEP, GL_INVERT));
508 dst.push_back(StencilOp::clearStencil(inv));
509 dst.push_back(StencilOp
510 dst.push_back(StencilOp::quad(GL_NOTEQUAL, targetStencil, GL_ALWAYS, 0.0f, GL_KEEP, GL_KEEP, GL_INVERT));
517 dst.push_back(StencilOp::clearStencil(targetStencil+1));
518 dst.push_back(StencilOp::quad(GL_LESS, targetStencil, GL_ALWAYS, 0.0f, GL_KEEP, GL_KEEP, GL_DECR));
519 dst.push_back(StencilOp::quad(GL_LESS, targetStencil, GL_ALWAYS, 0.0f, GL_KEEP, GL_KEEP, GL_DECR));
522 dst.push_back(StencilOp::clearStencil(targetStencil));
529 dst.push_back(StencilOp::clearStencil(targetStencil+1));
530 dst.push_back(StencilOp::quad(GL_LEQUAL, targetStencil+1, GL_ALWAYS, 0.0f, GL_KEEP, GL_KEEP, GL_DECR));
531 dst.push_back(StencilOp::quad(GL_LEQUAL, targetStencil+1, GL_ALWAYS, 0.0f, GL_KEEP, GL_KEEP, GL_DECR));
534 dst.push_back(StencilOp::clearStencil(targetStencil));
540 dst.push_back(StencilOp::clearStencil(targetStencil-1));
541 dst.push_back(StencilOp::quad(GL_GREATER, targetStencil, GL_ALWAYS, 0.0f, GL_KEEP, GL_KEEP, GL_INCR));
542 dst.push_back(StencilOp::quad(GL_GREATER, targetStencil, GL_ALWAYS, 0.0f, GL_KEEP, GL_KEEP, GL_INCR));
545 dst.push_back(StencilOp::clearStencil(targetStencil));
551 dst.push_back(StencilOp::clearStencil(targetStencil-1));
552 dst.push_back(StencilOp::quad(GL_GEQUAL, targetStencil-1, GL_ALWAYS, 0.0f, GL_KEEP, GL_KEEP, GL_INCR));
553 dst.push_back(StencilOp::quad(GL_GEQUAL, targetStencil-1, GL_ALWAYS, 0.0f, GL_KEEP, GL_KEEP, GL_INCR));
556 dst.push_back(StencilOp::clearStencil(targetStencil));
562 dst.push_back(StencilOp::clearStencil(~targetStencil));
563 StencilOp op = StencilOp::quad(GL_EQUAL, (~targetStencil | ~mask) & valMask, GL_ALWAYS, 0.0f, GL_KEEP, GL_KEEP, GL_INVERT);