A rendering context, attached to a window or an offscreen texture.
More...
A rendering context, attached to a window or an offscreen texture.
See RenderContextManager::createRenderContext() for instantiation.
◆ ~RenderContext()
virtual nkGraphics::RenderContext::~RenderContext |
( |
| ) |
|
|
virtual |
◆ getBackBuffer()
Texture* nkGraphics::RenderContext::getBackBuffer |
( |
| ) |
const |
- Returns
- The texture serving as a back buffer.
◆ getDepthBuffer()
Texture* nkGraphics::RenderContext::getDepthBuffer |
( |
| ) |
const |
- Returns
- The depth buffer associated to the context.
◆ getTimer()
GlobalTimer* nkGraphics::RenderContext::getTimer |
( |
| ) |
const |
- Returns
- The timer associated to this render context.
◆ getViewport()
Viewport* nkGraphics::RenderContext::getViewport |
( |
| ) |
const |
- Returns
- The viewport used.
◆ getCompositor()
Compositor* nkGraphics::RenderContext::getCompositor |
( |
| ) |
const |
- Returns
- The compositor the context is using. If nullptr, it means the default compositor within the CompositorManager is used.
◆ getRenderCamera()
Camera* nkGraphics::RenderContext::getRenderCamera |
( |
| ) |
const |
- Returns
- The currently used camera for general rendering, when using the context.
◆ getCullingCamera()
Camera* nkGraphics::RenderContext::getCullingCamera |
( |
| ) |
const |
- Returns
- The currently used camera for frustum culling, when using the context.
◆ getLodCamera()
Camera* nkGraphics::RenderContext::getLodCamera |
( |
| ) |
const |
- Returns
- The currently used camera for LOD selection, when using the context.
◆ getWidth()
int nkGraphics::RenderContext::getWidth |
( |
| ) |
const |
- Returns
- The width, in pixels, of the context.
◆ getHeight()
int nkGraphics::RenderContext::getHeight |
( |
| ) |
const |
- Returns
- The height, in pixels, of the context.
◆ isWindowFocused()
bool nkGraphics::RenderContext::isWindowFocused |
( |
| ) |
const |
- Returns
- Whether the context window is focused (true) or not (false).
◆ getAttachedWin()
- Returns
- The attached window in which the context renders.
◆ getOwnsSurface()
bool nkGraphics::RenderContext::getOwnsSurface |
( |
| ) |
const |
- Returns
- Whether the context owns the window or texture it renders to (true) or not (false). A context owns a window when it is not fed a window or texture from external code.
◆ setCompositor()
void nkGraphics::RenderContext::setCompositor |
( |
Compositor * |
value | ) |
|
Sets the compositor the context should be rendered with.
- Parameters
-
value | The compositor to use. Can be reset with nullptr. |
◆ setRenderCamera()
void nkGraphics::RenderContext::setRenderCamera |
( |
Camera * |
value | ) |
|
Sets the camera to use during rendering. This camera drives what information the shaders will receive, like the transformation matrices for instance. If this camera is not overloaded, then the used camera will be the default camera registered within the CameraManager.
- Parameters
-
value | The camera to use. Can be reset with nullptr. |
◆ setCullingCamera()
void nkGraphics::RenderContext::setCullingCamera |
( |
Camera * |
value | ) |
|
Sets the camera to use during frustum culling. This camera will be used by the DefaultRenderStrategy if frustum culling is enabled. If this camera is not overloaded, then the used camera will be the overloaded render camera if set, or the default camera registered within the CameraManager else.
- Parameters
-
value | The camera to use. Can be reset with nullptr. |
◆ setLodCamera()
void nkGraphics::RenderContext::setLodCamera |
( |
Camera * |
value | ) |
|
Sets the camera to use during LOD selection. This camera will be used by the DefaultRenderStrategy if LOD selection is enabled. If this camera is not overloaded, then the used camera will be the overloaded render camera if set, or the default camera registered within the CameraManager else.
- Parameters
-
value | The camera to use. Can be reset with nullptr. |
◆ setOwnsSurface()
void nkGraphics::RenderContext::setOwnsSurface |
( |
bool |
value | ) |
|
Sets whether the context owns the window or texture it is attached to.
- Parameters
-
value | Whether the context owns the surface (true) or not (false). |
◆ setGammaCorrected()
virtual void nkGraphics::RenderContext::setGammaCorrected |
( |
bool |
value | ) |
|
|
pure virtual |
Sets whether the context should be gamma corrected or not.
- Parameters
-
value | Whether the context should be gamma corrected (true) or not (false). |
◆ initialize()
Initializes and loads all internal memory necessary.
◆ swap()
virtual void nkGraphics::RenderContext::swap |
( |
| ) |
|
|
pure virtual |
Part of the rendering logic. In theory, should not be called by external code.
◆ refreshBufferSize()
virtual void nkGraphics::RenderContext::refreshBufferSize |
( |
unsigned int |
width = 0 , |
|
|
unsigned int |
height = 0 |
|
) |
| |
|
pure virtual |
Callback for when the window size changes. Can also be used to resize manually the surfaces (window, texture) the context owns.
- Parameters
-
width | The wanted width of the surface, in pixels. |
height | The wanted height of the surface, in pixels. |
◆ refreshViewportSize()
virtual void nkGraphics::RenderContext::refreshViewportSize |
( |
| ) |
|
|
virtual |
Callback for when the window size changes.
The documentation for this class was generated from the following file: