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

Manages the render contexts recorded. More...

Inheritance diagram for nkGraphics::RenderContextManager:

Public Member Functions

const std::unordered_map< void *, nkMemory::UniquePtr< RenderContext > > & getRenderContextMap () const
 
RenderContextgetRenderContextOf (nkWinUi::Window *win) const
 
RenderContextgetActiveRenderContext () const
 
RenderContextgetDefaultRenderContext () const
 
RenderContextcreateRenderContext (const RenderContextDescriptor &contextDesc)
 
void activateContextOf (nkWinUi::Window *win)
 
void activateContext (RenderContext *context)
 
void eraseFor (nkWinUi::Window *win)
 
void erase (RenderContext *context)
 

Detailed Description

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.

Member Function Documentation

◆ getRenderContextMap()

const std::unordered_map<void*, nkMemory::UniquePtr<RenderContext> >& nkGraphics::RenderContextManager::getRenderContextMap ( ) const
Returns
Internal context map, used for tracking.

◆ getRenderContextOf()

RenderContext* nkGraphics::RenderContextManager::getRenderContextOf ( nkWinUi::Window win) const

Retrieves the context associated to a window.

Parameters
winThe window which context is needed.
Returns
The context associated to given window if available, nullptr else.

◆ getActiveRenderContext()

RenderContext* nkGraphics::RenderContextManager::getActiveRenderContext ( ) const
Returns
The active render context.

◆ getDefaultRenderContext()

RenderContext* nkGraphics::RenderContextManager::getDefaultRenderContext ( ) const
Returns
The default render context.

◆ createRenderContext()

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.

Parameters
contextDescThe description of the context to create.
Returns
A freshly created context. The manager owns the memory, external code should not delete it.

◆ activateContextOf()

void nkGraphics::RenderContextManager::activateContextOf ( nkWinUi::Window win)

Activates a context and prepares the rendering pipeline for all its defined parameters.

Parameters
winThe window from which the context should be activated.

◆ activateContext()

void nkGraphics::RenderContextManager::activateContext ( RenderContext context)

Activates a context and prepares the rendering pipeline for all its defined parameters.

Parameters
contextThe context to activate.

◆ eraseFor()

void nkGraphics::RenderContextManager::eraseFor ( nkWinUi::Window win)

Erases and frees the memory of a context.

Parameters
winThe window from which the context should be deleted.

◆ erase()

void nkGraphics::RenderContextManager::erase ( RenderContext context)

Erases and frees the memory of a context.

Parameters
contextThe context to free.

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