nCine::GLScissorTest class

Manages the OpenGL scissor test state.

Static wrapper that caches the current scissor test state (GL_SCISSOR_TEST enable flag and the glScissor rectangle) so that redundant OpenGL calls are skipped when the requested state matches the cached one.

Public types

struct State
Holds the cached scissor test state.

Public static functions

static auto IsEnabled() -> bool
Returns whether the scissor test is enabled.
static auto GetRect() -> Recti
Returns the current scissor rectangle.
static void Enable(const Recti& rect)
Enables the scissor test with the specified rectangle.
static void Enable(GLint x, GLint y, GLsizei width, GLsizei height)
Enables the scissor test with the specified rectangle.
static void Enable()
Enables the scissor test reusing the cached rectangle.
static void Disable()
Disables the scissor test.
static auto GetState() -> State
Returns the whole cached scissor test state.
static void SetState(State newState)
Restores the whole scissor test state.

Constructors, destructors, conversion operators

GLScissorTest() deleted
~GLScissorTest() deleted

Function documentation

static void nCine::GLScissorTest::Enable(const Recti& rect)

Enables the scissor test with the specified rectangle.

Parameters
rect Scissor rectangle

static void nCine::GLScissorTest::Enable(GLint x, GLint y, GLsizei width, GLsizei height)

Enables the scissor test with the specified rectangle.

Parameters
x Left coordinate of the scissor rectangle
y Bottom coordinate of the scissor rectangle
width Width of the scissor rectangle
height Height of the scissor rectangle