Lysa  0.0
Lysa 3D Engine
RenderTarget Class Reference

Detailed Description

Render target for displaying the scene

+ Inheritance diagram for RenderTarget:

Public Member Functions

 RenderTarget (const RenderTargetConfiguration &config, vireo::PlatformWindowHandle renderingWindowHandle)
 
 ~RenderTarget () override
 
void render ()
 
auto isPaused () const
 
void setPause (bool pause)
 
float getWidth () const
 
float getHeight () const
 
float getAspectRatio () const
 
uint32 getFramesInFlight () const
 
uint32 getCurrentFrameIndex () const
 
const vireo::Extent & getExtent () const
 
vireo::ImageFormat getImageFormat () const
 
void waitIdle () const
 
void addView (RenderView &view)
 
void updateView (RenderView &view)
 
void removeView (const RenderView &view)
 
void updatePipelines (const std::unordered_map< pipeline_id, std::vector< unique_id >> &pipelineIds) const
 
void resize ()
 
const RendererConfigurationgetRendererConfiguration () const
 
void addSceneRenderer (Vector3DRenderer &vector3DRenderer)
 
void removeSceneRenderer (Vector3DRenderer &vector3DRenderer)
 
void addUIRenderer (Vector2DRenderer &vector2DRenderer)
 
void removeUIRenderer (Vector2DRenderer &vector2DRenderer)
 
void setGammaCorrectionParameters (float gamma, float exposure) const
 
void setVectorGammaCorrectionParameters (float gamma, float exposure) const
 
RenderergetRenderer () const
 
vireo::Extent getRenderingExtent () const
 
- Public Member Functions inherited from UniqueResource
 UniqueResource () = default
 
 UniqueResource (UniqueResource &) = delete
 
UniqueResource & operator= (UniqueResource &) = delete
 
- Public Member Functions inherited from UnmanagedResource
 UnmanagedResource ()
 
 UnmanagedResource (const Resource &other)
 
- Public Member Functions inherited from Resource
bool operator== (const Resource &other) const
 
 Resource () = default
 
 Resource (const unique_id id)
 
virtual ~Resource () = default
 

Additional Inherited Members

- Public Attributes inherited from Resource
unique_id id {INVALID_ID}
 

Constructor & Destructor Documentation

RenderTarget ( const RenderTargetConfiguration config,
vireo::PlatformWindowHandle  renderingWindowHandle 
)

Creates a RenderTarget

Parameters
configThe configuration for the render target
renderingWindowHandleThe handle to the platform window
~RenderTarget ( )
override

Member Function Documentation

void addSceneRenderer ( Vector3DRenderer vector3DRenderer)
inline

Adds a vector renderer for the scene

void addUIRenderer ( Vector2DRenderer vector2DRenderer)

Adds a vector renderer for the UI

void addView ( RenderView view)

Adds a view to the render target

float getAspectRatio ( ) const
inline

Returns the aspect ratio ((width / height) of the render target

uint32 getCurrentFrameIndex ( ) const
inline

Returns the current frame index

const vireo::Extent& getExtent ( ) const
inline

Returns the extent of the swap chain

uint32 getFramesInFlight ( ) const
inline

Returns the number of frames in flight

float getHeight ( ) const
inline

Returns the height in pixels of the render target

vireo::ImageFormat getImageFormat ( ) const
inline

Returns the image format of the swap chain

Renderer& getRenderer ( ) const
inline

Returns the scene renderer

const RendererConfiguration& getRendererConfiguration ( ) const
inline

Returns the renderer configuration

vireo::Extent getRenderingExtent ( ) const

Returns the actual rendered extent, which may differ from the swap-chain extent when frame scaling is active.

float getWidth ( ) const
inline

Returns the width in pixels of the render target

auto isPaused ( ) const
inline

Returns true if the rendering is paused

void removeSceneRenderer ( Vector3DRenderer vector3DRenderer)
inline

Removes a vector renderer from the scene

void removeUIRenderer ( Vector2DRenderer vector2DRenderer)
inline

Removes a UI renderer from the scene

void removeView ( const RenderView view)

Removes a view from the render target

void render ( )

Renders the scene into the target

void resize ( )

Resizes the render target

void setGammaCorrectionParameters ( float  gamma,
float  exposure 
) const
void setPause ( bool  pause)

Pauses or resumes the rendering

void setVectorGammaCorrectionParameters ( float  gamma,
float  exposure 
) const
void updatePipelines ( const std::unordered_map< pipeline_id, std::vector< unique_id >> &  pipelineIds) const

Updates the pipelines

void updateView ( RenderView view)

Updates a view in the render target

void waitIdle ( ) const
inline

Waits for the GPU to finish all work on this target