Manages the viewports available in the component. More...
Public Member Functions | |
Viewport * | getActiveViewport () const |
void | setActiveViewport (Viewport *value) |
Viewport * | createOrRetrieve (nkMemory::StringView name) |
Viewport * | get (nkMemory::StringView name) const |
Viewport * | getByIndex (unsigned int index) const |
void | rename (nkMemory::StringView currentName, nkMemory::StringView newName) |
void | erase (nkMemory::StringView name) |
Manages the viewports available in the component.
At all times, the manager owns the memory it allocates. External code should never delete it.
Viewport* nkGraphics::ViewportManager::getActiveViewport | ( | ) | const |
void nkGraphics::ViewportManager::setActiveViewport | ( | Viewport * | value | ) |
Sets currently active viewport for the pass. This is used during rendering to keep track of what is active and feed shaders with the right information.
value | The viewport active. |
Viewport* nkGraphics::ViewportManager::createOrRetrieve | ( | nkMemory::StringView | name | ) |
Creates if unavailable, or retrieve if available, viewport attached with given name.
name | The name of the viewport to retrieve. |
Viewport* nkGraphics::ViewportManager::get | ( | nkMemory::StringView | name | ) | const |
Retrives an existing viewport.
name | The name of the viewport to retrieve. |
Viewport* nkGraphics::ViewportManager::getByIndex | ( | unsigned int | index | ) | const |
Accesses a viewport, by index in the manager memory. Note that an index can point to different viewport after manipulating the manager memory (add or remove viewports). This function mainly serves to go over all existing viewports in one go.
index | The index of the viewport to retrieve. |
void nkGraphics::ViewportManager::rename | ( | nkMemory::StringView | currentName, |
nkMemory::StringView | newName | ||
) |
Renames a viewport from one name to another.
currentName | The name of the viewport to rename. |
newName | The new name to assign to the viewport/ |
void nkGraphics::ViewportManager::erase | ( | nkMemory::StringView | name | ) |
Erases a viewport and frees its memory.
name | The name of the viewport to erase. |