cohtml::ViewRenderer
On this page
The ViewRenderer is in charge of drawing a View in a user-supplied texture.
#include <ViewRenderer.h>
Public Functions
| Name | |
|---|---|
| virtual | ~ViewRenderer() |
| virtual void | Destroy() =0 Destroys the ViewRenderer. |
| virtual void | Paint(unsigned frameId) =0 Call this each frame to update the UI texture. This call will perform the actual rendering using the backend associated in the SystemRenderer. Should be called on the rendering thread. If the frame is not ready to be painted, the call blocks until it becomes ready. When ready, the frame will be painted and the call will return. |
| virtual void | SetRenderTarget(void * nativeTexture, void * nativeDepthStencil, unsigned width, unsigned height, unsigned samples) =0 Sets the user texture that will be used for rendering. The format of the texture is assumed to be RGBA8. |
| virtual void | SetRenderTarget(void * nativeTexture, void * nativeDepthStencil, renoir::Texture2D textureDescription) =0 Sets the user texture that will be used for rendering. |
Public Functions Documentation
function ~ViewRenderer
virtual ~ViewRenderer()
function Destroy
virtual void Destroy() =0
Destroys the ViewRenderer.
function Paint
virtual void Paint(
unsigned frameId
) =0
Call this each frame to update the UI texture. This call will perform the actual rendering using the backend associated in the SystemRenderer. Should be called on the rendering thread. If the frame is not ready to be painted, the call blocks until it becomes ready. When ready, the frame will be painted and the call will return.
function SetRenderTarget
virtual void SetRenderTarget(
void * nativeTexture,
void * nativeDepthStencil,
unsigned width,
unsigned height,
unsigned samples
) =0
Sets the user texture that will be used for rendering. The format of the texture is assumed to be RGBA8.
Parameters:
- nativeTexture An opaque object that will later be passed to the rendering backend. This should represent the texture to draw into in whatever object is expected by the backend.
- nativeDepthStencil An opaque object that will later be passed to the rendering backend. This should represent the depth-stencil texture in whatever object is expected by the backend. Passing nullptr will result in using a shared internal DS texture instead.
- width the width of the backend texture
- height the height of the backend texture
- samples the number of samples of the target texture if MSAA is used. Set to 1 if no MSAA is enabled.
function SetRenderTarget
virtual void SetRenderTarget(
void * nativeTexture,
void * nativeDepthStencil,
renoir::Texture2D textureDescription
) =0
Sets the user texture that will be used for rendering.
Parameters:
- nativeTexture An opaque object that will later be passed to the rendering backend. This should represent the texture to draw into in whatever object is expected by the backend.
- nativeDepthStencil An opaque object that will later be passed to the rendering backend. This should represent the depth-stencil texture in whatever object is expected by the backend. Passing nullptr will result in using a shared internal DS texture instead.
- textureDescription A Description of the texture that will be used as render target. This should describe the dimensions, the samples count and the format of the texture.