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

A descriptor, used when creating a context along with its window. More...

Public Member Functions

 RenderContextDescriptor () noexcept
 
 RenderContextDescriptor (nkWinUi::Window *window, bool vsync=false) noexcept
 
 RenderContextDescriptor (Texture *colorTarget) noexcept
 
 RenderContextDescriptor (Texture *colorTarget, Texture *depthTarget) noexcept
 
 RenderContextDescriptor (unsigned int width, unsigned int height, bool forOffscreen, bool vsync=false) noexcept
 
unsigned int getWidth () const
 
unsigned int getHeight () const
 
nkWinUi::WindowgetWindow () const
 
TexturegetColorTarget () const
 
TexturegetDepthTarget () const
 
bool getOffscreenContext () const
 
bool getVsync () const
 

Detailed Description

A descriptor, used when creating a context along with its window.

See RenderContextManager::createRenderContext() for more information.

Constructor & Destructor Documentation

◆ RenderContextDescriptor() [1/5]

nkGraphics::RenderContextDescriptor::RenderContextDescriptor ( )
noexcept

Default constructor.

◆ RenderContextDescriptor() [2/5]

nkGraphics::RenderContextDescriptor::RenderContextDescriptor ( nkWinUi::Window window,
bool  vsync = false 
)
noexcept

On window constructor.

Parameters
windowThe window the context described should render to.
vsyncWhether the context described should use vsync (true) or not (false).
Remarks
The context will be considered as rendering on screen, and size will be derived from the window given.

◆ RenderContextDescriptor() [3/5]

nkGraphics::RenderContextDescriptor::RenderContextDescriptor ( Texture colorTarget)
noexcept

On texture constructor. The texture will be used as the color target.

Parameters
colorTargetThe texture the context described should render to.
Remarks
The context will be considered as rendering off screen, and size will be derived from the texture given.

◆ RenderContextDescriptor() [4/5]

nkGraphics::RenderContextDescriptor::RenderContextDescriptor ( Texture colorTarget,
Texture depthTarget 
)
noexcept

On textures constructor.

Parameters
colorTargetThe texture the context described should render to.
depthTargetThe texture the context described should use as a depth buffer.
Remarks
The context will be considered as rendering off screen, and size will be derived from the color target given.

◆ RenderContextDescriptor() [5/5]

nkGraphics::RenderContextDescriptor::RenderContextDescriptor ( unsigned int  width,
unsigned int  height,
bool  forOffscreen,
bool  vsync = false 
)
noexcept

Automatic constructor.

Parameters
widthThe width of the context described, in pixels.
heightThe height of the context described, in pixels.
forOffscreenWhether the context described should be off-screen (true) or not (false).
vsyncWhether the context described should use vsync (true) or not (false). This can only work when rendering to a window.
Remarks
For on-screen contexts, a window will be created, while off-screen contexts will create a texture. In both cases, the associated depth will also be created.

Member Function Documentation

◆ getWidth()

unsigned int nkGraphics::RenderContextDescriptor::getWidth ( ) const
Returns
The width set into the descriptor.
Remarks
The value returned won't be derived from a potential window or texture. Rather, it will be directly mapped to the value provided to the automatic constructor.

◆ getHeight()

unsigned int nkGraphics::RenderContextDescriptor::getHeight ( ) const
Returns
The height set into the descriptor.
Remarks
The value returned won't be derived from a potential window or texture. Rather, it will be directly mapped to the value provided to the automatic constructor.

◆ getWindow()

nkWinUi::Window* nkGraphics::RenderContextDescriptor::getWindow ( ) const
Returns
The window set into the descriptor.

◆ getColorTarget()

Texture* nkGraphics::RenderContextDescriptor::getColorTarget ( ) const
Returns
The color target set into the descriptor.

◆ getDepthTarget()

Texture* nkGraphics::RenderContextDescriptor::getDepthTarget ( ) const
Returns
The depth target set into the descriptor.

◆ getOffscreenContext()

bool nkGraphics::RenderContextDescriptor::getOffscreenContext ( ) const
Returns
Whether the descriptor has been set as offscreen (true) or not (false).
Remarks
The value returned won't be derived from a potential window or texture. Rather, it will be directly mapped to the value provided to the automatic constructor.

◆ getVsync()

bool nkGraphics::RenderContextDescriptor::getVsync ( ) const
Returns
Whether the descriptor has been set to use vertical sync (true) or not (false).
Remarks
The value returned won't be derived from a potential window or texture. Rather, it will be directly mapped to the value provided to the automatic or window constructor.

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