MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / Enable

Method Enable

GTE/Graphics/GL46/GL46DepthStencilState.cpp:46–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void 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
78GLboolean const GL46DepthStencilState::msWriteMask[] =

Callers

nothing calls this directly

Calls 7

glEnableFunction · 0.85
glDepthFuncFunction · 0.85
glDisableFunction · 0.85
glDepthMaskFunction · 0.85
glStencilFuncSeparateFunction · 0.85
glStencilMaskSeparateFunction · 0.85
glStencilOpSeparateFunction · 0.85

Tested by

no test coverage detected