API Documentation
Public Member Functions | Public Attributes | 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) noexcept
 
 RenderContextDescriptor (nkGraphics::Texture *texture) noexcept
 
 RenderContextDescriptor (unsigned int width, unsigned int height, bool forOffscreen, bool vsync=false) noexcept
 

Public Attributes

unsigned int _width
 The width of the context, in pixels. Defaults to 1.
 
unsigned int _height
 The height of the context, in pixels. Defauls to 1.
 
union {
   nkWinUi::GraphicsWindow *   _window
 For non off-screen context creation, an already existing window can be specified here. Defaults to nullptr, triggering an automatic window creation.
 
   Texture *   _texture
 For off-screen context creation, an already existing texture to work on. Defaults to nullptr, triggering an automatic texture creation.
 
}; 
 
bool _offscreenContext
 If the context should be used for offscreen rendering (no window created, only works with texture). Defaults to false.
 
bool _vsync
 If the context should be using vsync (true) or not (false). Defaults to false.
 

Detailed Description

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

See RenderContextManager::createRenderContext() for more information.

Constructor & Destructor Documentation

◆ RenderContextDescriptor() [1/4]

nkGraphics::RenderContextDescriptor::RenderContextDescriptor ( )
noexcept

Default constructor.

◆ RenderContextDescriptor() [2/4]

nkGraphics::RenderContextDescriptor::RenderContextDescriptor ( nkWinUi::Window window)
noexcept

On window constructor.

Parameters
windowThe window the context described should render to.
Remarks
The context will be considered as rendering on screen, and size will be derived from the window given.

◆ RenderContextDescriptor() [3/4]

nkGraphics::RenderContextDescriptor::RenderContextDescriptor ( nkGraphics::Texture texture)
noexcept

On texture constructor.

Parameters
textureThe 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/4]

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).
Remarks
For on-screen contexts, a window will be created, while off-screen contexts will create a texture.

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