Manages the compositors recorded. More...
Public Member Functions | |
Compositor * | getActiveCompositor () const |
Compositor * | getDefaultCompositor () const |
void | setActiveCompositor (Compositor *compositor) |
void | setDefaultCompositor (Compositor *compositor) |
void | prepareForContext (RenderContext *context) |
Public Member Functions inherited from nkGraphics::Manager< Compositor > | |
Compositor * | createOrRetrieve (nkMemory::StringView name) |
Compositor * | record (nkMemory::StringView name, nkMemory::UniquePtr< Compositor > resource) |
Compositor * | get (nkMemory::StringView name) const |
Compositor * | getByIndex (unsigned int index) const |
void | rename (nkMemory::StringView currentName, nkMemory::StringView newName) |
void | erase (nkMemory::StringView name) |
nkMemory::UniquePtr< Compositor > | relinquish (nkMemory::StringView name) |
Manages the compositors recorded.
Compositor creation / deletion can go through this class, allowing it to act as a repository of resources which lifetime will get managed as needed. Like any Manager, it is always owning the memory it owns, unless it passes back the ownership explicitly.
Compositor* nkGraphics::CompositorManager::getActiveCompositor | ( | ) | const |
Compositor* nkGraphics::CompositorManager::getDefaultCompositor | ( | ) | const |
void nkGraphics::CompositorManager::setActiveCompositor | ( | Compositor * | compositor | ) |
Sets the compositor currently active. This compositor will be the reference for given rendering iteration.
compositor | The compositor to use. |
void nkGraphics::CompositorManager::setDefaultCompositor | ( | Compositor * | compositor | ) |
Sets the default compositor. This compositor will be the activated one when a context has no compositor attached.
compositor | The compositor to use. |
void nkGraphics::CompositorManager::prepareForContext | ( | RenderContext * | context | ) |
Prepares the rendering and sets as active the compositor tied to the context given. If none is set, the default compositor will be activated.
context | The context from which to activate a compositor. |