API Documentation
Public Member Functions | List of all members
nkGraphics::ViewportManager Class Referencefinal

Manages the viewports available in the component. More...

Inheritance diagram for nkGraphics::ViewportManager:

Public Member Functions

ViewportgetActiveViewport () const
 
void setActiveViewport (Viewport *value)
 
ViewportcreateOrRetrieve (nkMemory::StringView name)
 
Viewportget (nkMemory::StringView name) const
 
ViewportgetByIndex (unsigned int index) const
 
void rename (nkMemory::StringView currentName, nkMemory::StringView newName)
 
void erase (nkMemory::StringView name)
 

Detailed Description

Manages the viewports available in the component.

At all times, the manager owns the memory it allocates. External code should never delete it.

Member Function Documentation

◆ getActiveViewport()

Viewport* nkGraphics::ViewportManager::getActiveViewport ( ) const
Returns
The currently active viewport.

◆ setActiveViewport()

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.

Parameters
valueThe viewport active.

◆ createOrRetrieve()

Viewport* nkGraphics::ViewportManager::createOrRetrieve ( nkMemory::StringView  name)

Creates if unavailable, or retrieve if available, viewport attached with given name.

Parameters
nameThe name of the viewport to retrieve.
Returns
The viewport, possibly freshly created. The manager owns memory returned, external code should never free it.

◆ get()

Viewport* nkGraphics::ViewportManager::get ( nkMemory::StringView  name) const

Retrives an existing viewport.

Parameters
nameThe name of the viewport to retrieve.
Returns
The viewport requested if available, nullptr else.

◆ getByIndex()

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.

Parameters
indexThe index of the viewport to retrieve.
Returns
The viewport requested if available, nullptr else.

◆ rename()

void nkGraphics::ViewportManager::rename ( nkMemory::StringView  currentName,
nkMemory::StringView  newName 
)

Renames a viewport from one name to another.

Parameters
currentNameThe name of the viewport to rename.
newNameThe new name to assign to the viewport/

◆ erase()

void nkGraphics::ViewportManager::erase ( nkMemory::StringView  name)

Erases a viewport and frees its memory.

Parameters
nameThe name of the viewport to erase.

The documentation for this class was generated from the following file: