nCine::GLDepthTest class

Manages the OpenGL depth test state.

Static wrapper that caches the current depth test state (GL_DEPTH_TEST enable flag and the depth buffer write mask set with glDepthMask) so that redundant OpenGL calls are skipped when the requested state matches the cached one.

Public types

struct State
Holds the cached depth test state.

Public static functions

static auto IsEnabled() -> bool
Returns whether the depth test is enabled.
static void Enable()
Enables the depth test.
static void Disable()
Disables the depth test.
static auto IsDepthMaskEnabled() -> bool
Returns whether writing to the depth buffer is enabled.
static void EnableDepthMask()
Enables writing to the depth buffer.
static void DisableDepthMask()
Disables writing to the depth buffer.
static auto GetState() -> State
Returns the whole cached depth test state.
static void SetState(State newState)
Restores the whole depth test state.

Constructors, destructors, conversion operators

GLDepthTest() deleted
~GLDepthTest() deleted