setEnabled(state.isEnabled(), record); if (state.isEnabled()) { if (state.isUseTwoSided()) { GL20C.glStencilMaskSeparate(GL11C.GL_BACK, state.getStencilWriteMaskBack()); getGLStencilFunction(state.getStencilFunctionBack()), // state.getStencilReferenceBack(), // state.getStencilFuncMaskBack()); getGLStencilOp(state.getStencilOpFailBack()), // getGLStencilOp(state.getStencilOpZFailBack()), // getGLStencilOp(state.getStencilOpZPassBack())); GL20C.glStencilMaskSeparate(GL11C.GL_FRONT, state.getStencilWriteMaskFront()); getGLStencilFunction(state.getStencilFunctionFront()), // state.getStencilReferenceFront(), // state.getStencilFuncMaskFront()); getGLStencilOp(state.getStencilOpFailFront()), // getGLStencilOp(state.getStencilOpZFailFront()), // getGLStencilOp(state.getStencilOpZPassFront())); } else { GL11C.glStencilMask(state.getStencilWriteMaskFront()); getGLStencilFunction(state.getStencilFunctionFront()), // state.getStencilReferenceFront(), // state.getStencilFuncMaskFront());
context.setCurrentState(StateType.Stencil, state); setEnabled(state.isEnabled(), caps.isTwoSidedStencilSupported() ? state.isUseTwoSided() : false, record, caps); if (state.isEnabled()) { if (state.isUseTwoSided() && caps.isTwoSidedStencilSupported()) { EXTStencilTwoSide.glActiveStencilFaceEXT(GL11.GL_BACK); applyMask(state.getStencilWriteMaskBack(), record, 2); applyFunc(getGLStencilFunction(state.getStencilFunctionBack()), state.getStencilReferenceBack(), state.getStencilFuncMaskBack(), record, 2); applyOp(getGLStencilOp(state.getStencilOpFailBack(), caps), getGLStencilOp(state.getStencilOpZFailBack(), caps), getGLStencilOp(state.getStencilOpZPassBack(), caps), record, 2); applyMask(state.getStencilWriteMaskFront(), record, 1); applyFunc(getGLStencilFunction(state.getStencilFunctionFront()), state.getStencilReferenceFront(), state.getStencilFuncMaskFront(), record, 1); applyOp(getGLStencilOp(state.getStencilOpFailFront(), caps), getGLStencilOp(state.getStencilOpZFailFront(), caps), getGLStencilOp(state.getStencilOpZPassFront(), caps), record, 1); } else { applyMask(state.getStencilWriteMaskFront(), record, 0); applyFunc(getGLStencilFunction(state.getStencilFunctionFront()), state.getStencilReferenceFront(), state.getStencilFuncMaskFront(), record, 0); applyOp(getGLStencilOp(state.getStencilOpFailFront(), caps), getGLStencilOp(state.getStencilOpZFailFront(), caps), getGLStencilOp(state.getStencilOpZPassFront(), caps), record, 0);
context.setCurrentState(StateType.Stencil, state); setEnabled(state.isEnabled(), caps.isTwoSidedStencilSupported() ? state.isUseTwoSided() : false, record, caps); if (state.isEnabled()) { if (state.isUseTwoSided() && caps.isTwoSidedStencilSupported()) { gl.getGL2().glActiveStencilFaceEXT(GL.GL_BACK); applyMask(state.getStencilWriteMaskBack(), record, 2); applyFunc(getGLStencilFunction(state.getStencilFunctionBack()), state.getStencilReferenceBack(), state.getStencilFuncMaskBack(), record, 2); applyOp(getGLStencilOp(state.getStencilOpFailBack(), caps), getGLStencilOp(state.getStencilOpZFailBack(), caps), getGLStencilOp(state.getStencilOpZPassBack(), caps), record, 2); applyMask(state.getStencilWriteMaskFront(), record, 1); applyFunc(getGLStencilFunction(state.getStencilFunctionFront()), state.getStencilReferenceFront(), state.getStencilFuncMaskFront(), record, 1); applyOp(getGLStencilOp(state.getStencilOpFailFront(), caps), getGLStencilOp(state.getStencilOpZFailFront(), caps), getGLStencilOp(state.getStencilOpZPassFront(), caps), record, 1); } else { applyMask(state.getStencilWriteMaskFront(), record, 0); applyFunc(getGLStencilFunction(state.getStencilFunctionFront()), state.getStencilReferenceFront(), state.getStencilFuncMaskFront(), record, 0); applyOp(getGLStencilOp(state.getStencilOpFailFront(), caps), getGLStencilOp(state.getStencilOpZFailFront(), caps), getGLStencilOp(state.getStencilOpZPassFront(), caps), record, 0);