25 #include "glfDepthBufferMode.hh"
26 #include "glfException.hh"
34 enableTest_ = GL_FALSE;
48 depthMask_ = flag ? GL_TRUE : GL_FALSE;
53 depthFunc_ = depthFunc;
66 glEnable(GL_DEPTH_TEST);
67 glDepthMask(depthMask_);
68 glDepthFunc(depthFunc_);
69 glDepthRange(nearVal_, farVal_);
71 glDisable(GL_DEPTH_TEST);
75 GLF_THROW_ON_OPENGL_ERROR;
Defines the usage of the depth buffer.
void SetDepthFunc(GLenum depthFunc)
Sets the depth buffer comparison function.
void SetDepthRange(double nearVal, double farVal)
Sets the mapping the used range of the depth buffer.
static const glfDepthBufferMode DEFAULT
The default depth buffer mode.
void SetDepthTest(bool enable)
Sets whether to use depth buffer tests.
void Bind() const
Binds the depth buffer mode.
void SetDepthMask(bool flag)
Sets whether to write to the depth buffer.