Manages the render contexts recorded. More...
Public Member Functions | |
const std::unordered_map< void *, nkMemory::UniquePtr< RenderContext > > & | getRenderContextMap () const |
RenderContext * | getRenderContextOf (nkWinUi::Window *win) const |
RenderContext * | getActiveRenderContext () const |
RenderContext * | getDefaultRenderContext () const |
RenderContext * | createRenderContext (const RenderContextDescriptor &contextDesc) |
void | activateContextOf (nkWinUi::Window *win) |
void | activateContext (RenderContext *context) |
void | eraseFor (nkWinUi::Window *win) |
void | erase (RenderContext *context) |
Manages the render contexts recorded.
RenderContext 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.
const std::unordered_map<void*, nkMemory::UniquePtr<RenderContext> >& nkGraphics::RenderContextManager::getRenderContextMap | ( | ) | const |
RenderContext* nkGraphics::RenderContextManager::getRenderContextOf | ( | nkWinUi::Window * | win | ) | const |
Retrieves the context associated to a window.
win | The window which context is needed. |
RenderContext* nkGraphics::RenderContextManager::getActiveRenderContext | ( | ) | const |
RenderContext* nkGraphics::RenderContextManager::getDefaultRenderContext | ( | ) | const |
RenderContext* nkGraphics::RenderContextManager::createRenderContext | ( | const RenderContextDescriptor & | contextDesc | ) |
Creates a render context. Depending on the description, the context will be rendering to a window, or a texture. Based on the description, the window / texture will be created on-the-fly or taken from user specified pointers.
contextDesc | The description of the context to create. |
void nkGraphics::RenderContextManager::activateContextOf | ( | nkWinUi::Window * | win | ) |
Activates a context and prepares the rendering pipeline for all its defined parameters.
win | The window from which the context should be activated. |
void nkGraphics::RenderContextManager::activateContext | ( | RenderContext * | context | ) |
Activates a context and prepares the rendering pipeline for all its defined parameters.
context | The context to activate. |
void nkGraphics::RenderContextManager::eraseFor | ( | nkWinUi::Window * | win | ) |
Erases and frees the memory of a context.
win | The window from which the context should be deleted. |
void nkGraphics::RenderContextManager::erase | ( | RenderContext * | context | ) |
Erases and frees the memory of a context.
context | The context to free. |