| 44 | } |
| 45 | |
| 46 | void GL46DepthStencilState::Enable() |
| 47 | { |
| 48 | if (mDepthEnable) |
| 49 | { |
| 50 | glEnable(GL_DEPTH_TEST); |
| 51 | glDepthFunc(mComparison); |
| 52 | } |
| 53 | else |
| 54 | { |
| 55 | glDisable(GL_DEPTH_TEST); |
| 56 | } |
| 57 | |
| 58 | glDepthMask(mWriteMask); |
| 59 | |
| 60 | if (mStencilEnable) |
| 61 | { |
| 62 | glEnable(GL_STENCIL_TEST); |
| 63 | |
| 64 | glStencilFuncSeparate(GL_FRONT, mFrontFace.comparison, mReference, mStencilReadMask); |
| 65 | glStencilMaskSeparate(GL_FRONT, mStencilWriteMask); |
| 66 | glStencilOpSeparate(GL_FRONT, mFrontFace.onFail, mFrontFace.onZFail, mFrontFace.onZPass); |
| 67 | glStencilFuncSeparate(GL_BACK, mBackFace.comparison, mReference, mStencilReadMask); |
| 68 | glStencilMaskSeparate(GL_BACK, mStencilWriteMask); |
| 69 | glStencilOpSeparate(GL_BACK, mBackFace.onFail, mBackFace.onZFail, mBackFace.onZPass); |
| 70 | } |
| 71 | else |
| 72 | { |
| 73 | glDisable(GL_STENCIL_TEST); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | |
| 78 | GLboolean const GL46DepthStencilState::msWriteMask[] = |
nothing calls this directly
no test coverage detected