Carna
Version 3.0.1
|
Defines a rendering viewport. The viewport is a property of the current OpenGL context. More...
#include <Viewport.h>
Public Member Functions | |
Viewport (unsigned int rootWidth, unsigned int rootHeight, bool fitSquare) | |
Creates root viewport. | |
Viewport (const Framebuffer &) | |
Viewport (const Viewport &parent, unsigned int left, unsigned int top, unsigned int width, unsigned int height) | |
Derives viewport from parent. | |
~Viewport () | |
Restores the parent viewport if this viewport is still active. | |
void | makeActive () const |
Makes this viewport the active one of the current OpenGL context. | |
bool | isActive () const |
Tells whether this viewport is currently active. | |
void | done () const |
Restores the previous viewport. More... | |
void | setWidth (unsigned int) |
Sets viewport width. More... | |
void | setHeight (unsigned int) |
Sets viewport height. More... | |
void | setMarginLeft (unsigned int) |
Sets viewport left margin. More... | |
void | setMarginTop (unsigned int) |
Sets viewport top margin. More... | |
unsigned int | width () const |
Tells viewport width. | |
unsigned int | height () const |
Tells viewport height. | |
unsigned int | parentWidth () const |
Tells parent viewport's width. | |
unsigned int | parentHeight () const |
Tells parent viewport's height. | |
unsigned int | marginLeft () const |
Tells viewport's left margin. | |
unsigned int | marginTop () const |
Tells viewport's top margin. | |
unsigned int | marginRight () const |
Tells viewport's right margin. | |
unsigned int | marginBottom () const |
Tells viewport's bottom margin. | |
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
The viewport specifies how normalized device coordinates are mapped to frame coordinates, as described here. This makes the viewport always somehow *"naturally"* related to a frame. It has proven to be convenient to organize viewports hierarchically. In this terms, each Viewport
instance is associated with another parent viewport that it is derived from. Viewports, that do not have such a parent viewport, are named root viewports.
Definition at line 48 of file Viewport.h.
|
explicit |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Carna::base::Viewport::done | ( | ) | const |
Restores the previous viewport.
isActive() == true
void Carna::base::Viewport::setHeight | ( | unsigned | int | ) |
Sets viewport height.
isActive() == false
void Carna::base::Viewport::setMarginLeft | ( | unsigned | int | ) |
Sets viewport left margin.
isActive() == false
void Carna::base::Viewport::setMarginTop | ( | unsigned | int | ) |
Sets viewport top margin.
isActive() == false
void Carna::base::Viewport::setWidth | ( | unsigned | int | ) |
Sets viewport width.
isActive() == false
Documentation generated by Doxygen