GLViewport class
#include <nCine/Graphics/GL/GLViewport.h>
Manages the OpenGL viewport rectangle.
Static wrapper that caches the current viewport rectangle (set with glViewport) so that redundant OpenGL calls are skipped when the requested rectangle matches the cached one.
Public types
- struct State
- Holds the cached viewport state.
Public static functions
- static auto GetRect() -> Recti
- Returns the current viewport rectangle.
- static void SetRect(const Recti& rect)
- Sets the viewport rectangle.
- static void SetRect(GLint x, GLint y, GLsizei width, GLsizei height)
- Sets the viewport rectangle.
- static auto GetState() -> State
- Returns the whole cached viewport state.
- static void SetState(State newState)
- Restores the whole viewport state.
Constructors, destructors, conversion operators
- GLViewport() deleted
- ~GLViewport() deleted
Function documentation
static void nCine:: GLViewport:: SetRect(const Recti& rect)
Sets the viewport rectangle.
| Parameters | |
|---|---|
| rect | Viewport rectangle |
static void nCine:: GLViewport:: SetRect(GLint x,
GLint y,
GLsizei width,
GLsizei height)
Sets the viewport rectangle.
| Parameters | |
|---|---|
| x | Left coordinate of the viewport rectangle |
| y | Bottom coordinate of the viewport rectangle |
| width | Width of the viewport rectangle |
| height | Height of the viewport rectangle |