Cogs.Core
Public Member Functions | List of all members
Cogs::Core::IRenderer Class Referenceabstract

Renderer interface used by the engine to control registered renderer instances. More...

#include <IRenderer.h>

Inheritance diagram for Cogs::Core::IRenderer:
Cogs::Core::Renderer

Public Member Functions

virtual ~IRenderer ()=default
 Provided for destruction via pointer to base.
 
virtual void initialize (IGraphicsDevice *device)=0
 
virtual void cleanup ()=0
 Cleanup the renderer, releasing all resources held.
 
virtual glm::vec2 getSize () const =0
 Get the output surface size of the renderer.
 
virtual IGraphicsDevicegetDevice ()=0
 Get the graphics device used by the renderer.
 
virtual void setMode (RenderMode mode)=0
 Set the rendering mode the renderer should use.
 
virtual RenderMode getMode () const =0
 Get the Rendering mode used by the renderer.
 
virtual void setBackgroundColor (const glm::vec4 &color)=0
 Set the background color applied to the output surface before rendering.
 
virtual glm::vec4 getBackgroundColor () const =0
 Get the reference to the background color.
 
virtual void beginFrame ()=0
 Signals the beginning of a new frame.
 
virtual void endFrame (uint32_t syncInterval=0, uint32_t presentFlags=Cogs::PresentFlags::None)=0
 Signals the end of the current frame.
 
virtual void render ()=0
 Kick off the actual rendering, allowing the renderer to produce its output.
 
virtual glm::mat4 getProjectionMatrix (const glm::mat4 projectionMatrix)=0
 Get an adjusted projection matrix used to render.
 
virtual glm::mat4 getViewFromViewportMatrix (const glm::mat4 inverseProjectionMatrix)=0
 Get an adjusted inverse projection matrix mainly used in post processing.
 
virtual float getClearDepth ()=0
 Get adjusted clear depth used to render.
 
virtual float getNearDepth ()=0
 Get adjusted near plane depth.
 
virtual IRenderResourcesgetResources ()=0
 Get the render resources interface.
 
virtual const RenderSettingsgetSettings () const =0
 Get the settings of the renderer.
 
virtual void registerExtension (IRendererExtension *extension)=0
 Register an extension with the renderer.
 
virtual void unregisterExtension (IRendererExtension *extension)=0
 Unregister an extension with the renderer.
 
virtual std::span< IRendererExtension * > getExtensions ()=0
 Get the list of all extensions.
 
virtual void renderScreenshot (const ScreenshotSettings &settings, std::vector< uint8_t > &bytes, uint32_t *stride)=0
 Render screenshot.
 
virtual unsigned getMaxLights () const =0
 Get the maximum number of lights.
 
virtual EngineBuffersgetEngineBuffers ()=0
 Get the reference to the EngineBuffers structure.
 
virtual RenderStatesgetRenderStates ()=0
 Get the reference to the RenderStates structure.
 
virtual EffectCachegetEffectCache ()=0
 Get the reference to the EffectCache structure.
 
virtual EffectFlags::EEffectFlags getEffectFlags () const =0
 Get the EffectFlags.
 
virtual EffectBindingsgetEffectBindings ()=0
 Get the reference to the EffectBindings structure.
 
virtual ActiveLightsgetActiveLights ()=0
 Get the reference to the ActiveLights structure.
 
virtual void updatePermutation (EnginePermutation *permutation)=0
 Updates the EnginePermutation.
 
virtual EnginePermutationsgetEnginePermutations ()=0
 Get the reference to the EnginePermutations structure.
 
virtual COGSCORE_DLL_API class ImguiRenderergetGuiRenderer ()=0
 
virtual COGSCORE_DLL_API class InspectorGuiRenderergetInspectorGuiRenderer ()=0
 
virtual COGSCORE_DLL_API class InspectorGuiRenderergetEngineInspectorGuiRenderer ()=0
 

Detailed Description

Renderer interface used by the engine to control registered renderer instances.

Any renderer to be used with the Engine must implement this interface.

Definition at line 153 of file IRenderer.h.

Member Function Documentation

◆ beginFrame()

virtual void Cogs::Core::IRenderer::beginFrame ( )
pure virtual

Signals the beginning of a new frame.

Implemented in Cogs::Core::Renderer.

Referenced by Cogs::Core::Engine::update().

◆ cleanup()

virtual void Cogs::Core::IRenderer::cleanup ( )
pure virtual

Cleanup the renderer, releasing all resources held.

Implemented in Cogs::Core::Renderer.

◆ endFrame()

virtual void Cogs::Core::IRenderer::endFrame ( uint32_t  syncInterval = 0,
uint32_t  presentFlags = Cogs::PresentFlags::None 
)
pure virtual

Signals the end of the current frame.

Implemented in Cogs::Core::Renderer.

Referenced by Cogs::Core::Engine::update().

◆ getActiveLights()

virtual ActiveLights & Cogs::Core::IRenderer::getActiveLights ( )
pure virtual

Get the reference to the ActiveLights structure.

Implemented in Cogs::Core::Renderer.

◆ getBackgroundColor()

virtual glm::vec4 Cogs::Core::IRenderer::getBackgroundColor ( ) const
pure virtual

Get the reference to the background color.

Implemented in Cogs::Core::Renderer.

◆ getClearDepth()

virtual float Cogs::Core::IRenderer::getClearDepth ( )
pure virtual

Get adjusted clear depth used to render.

The depth value is accounting for device coordinate system differences.

Implemented in Cogs::Core::Renderer.

◆ getDevice()

virtual IGraphicsDevice * Cogs::Core::IRenderer::getDevice ( )
pure virtual

Get the graphics device used by the renderer.

Implemented in Cogs::Core::Renderer.

Referenced by Cogs::Core::ShapeSystem::initialize(), and Cogs::Core::Image360System::update().

◆ getEffectBindings()

virtual EffectBindings & Cogs::Core::IRenderer::getEffectBindings ( )
pure virtual

Get the reference to the EffectBindings structure.

Implemented in Cogs::Core::Renderer.

◆ getEffectCache()

virtual EffectCache & Cogs::Core::IRenderer::getEffectCache ( )
pure virtual

Get the reference to the EffectCache structure.

Implemented in Cogs::Core::Renderer.

◆ getEffectFlags()

virtual EffectFlags::EEffectFlags Cogs::Core::IRenderer::getEffectFlags ( ) const
pure virtual

Get the EffectFlags.

Implemented in Cogs::Core::Renderer.

◆ getEngineBuffers()

virtual EngineBuffers & Cogs::Core::IRenderer::getEngineBuffers ( )
pure virtual

Get the reference to the EngineBuffers structure.

Implemented in Cogs::Core::Renderer.

◆ getEnginePermutations()

virtual EnginePermutations & Cogs::Core::IRenderer::getEnginePermutations ( )
pure virtual

Get the reference to the EnginePermutations structure.

Implemented in Cogs::Core::Renderer.

◆ getExtensions()

virtual std::span< IRendererExtension * > Cogs::Core::IRenderer::getExtensions ( )
pure virtual

Get the list of all extensions.

Implemented in Cogs::Core::Renderer.

◆ getMaxLights()

virtual unsigned Cogs::Core::IRenderer::getMaxLights ( ) const
pure virtual

Get the maximum number of lights.

Implemented in Cogs::Core::Renderer.

◆ getMode()

virtual RenderMode Cogs::Core::IRenderer::getMode ( ) const
pure virtual

Get the Rendering mode used by the renderer.

Implemented in Cogs::Core::Renderer.

◆ getNearDepth()

virtual float Cogs::Core::IRenderer::getNearDepth ( )
pure virtual

Get adjusted near plane depth.

The depth value is accounting for device coordinate system differences.

Implemented in Cogs::Core::Renderer.

◆ getProjectionMatrix()

virtual glm::mat4 Cogs::Core::IRenderer::getProjectionMatrix ( const glm::mat4  projectionMatrix)
pure virtual

Get an adjusted projection matrix used to render.

The matrix is accounting for device coordinate system differences.

Parameters
projectionMatrixGL-convention projection matrix used as base for the conversion.
Returns
A converted matrix, suitable for rendering on the current graphics device.

Implemented in Cogs::Core::Renderer.

Referenced by Cogs::Core::LightSystem::preRender(), and Cogs::Core::CameraSystem::updateProjection().

◆ getRenderStates()

virtual RenderStates & Cogs::Core::IRenderer::getRenderStates ( )
pure virtual

Get the reference to the RenderStates structure.

Implemented in Cogs::Core::Renderer.

◆ getResources()

virtual IRenderResources * Cogs::Core::IRenderer::getResources ( )
pure virtual

Get the render resources interface.

Returns
A pointer to the render resource store used by this renderer.

Implemented in Cogs::Core::Renderer.

Referenced by Cogs::Core::CameraSystem::postRender().

◆ getSettings()

virtual const RenderSettings & Cogs::Core::IRenderer::getSettings ( ) const
pure virtual

Get the settings of the renderer.

Implemented in Cogs::Core::Renderer.

◆ getSize()

virtual glm::vec2 Cogs::Core::IRenderer::getSize ( ) const
pure virtual

Get the output surface size of the renderer.

Returns
A two-component floating point vector containing the width and height in pixels.

Implemented in Cogs::Core::Renderer.

Referenced by Cogs::Core::GuiSystem::update().

◆ getViewFromViewportMatrix()

virtual glm::mat4 Cogs::Core::IRenderer::getViewFromViewportMatrix ( const glm::mat4  inverseProjectionMatrix)
pure virtual

Get an adjusted inverse projection matrix mainly used in post processing.

The matrix is accounting for how depth values are converted from clip space to viewport coordinates.

Parameters
inverseProjectionMatrixinverse of the actual projection matrix used for rendering.
Returns
A converted matrix, suitable for determining view space coordinates in post processing.

Implemented in Cogs::Core::Renderer.

Referenced by Cogs::Core::CameraSystem::updateProjection().

◆ registerExtension()

virtual void Cogs::Core::IRenderer::registerExtension ( IRendererExtension extension)
pure virtual

◆ render()

virtual void Cogs::Core::IRenderer::render ( )
pure virtual

Kick off the actual rendering, allowing the renderer to produce its output.

Implemented in Cogs::Core::Renderer.

◆ renderScreenshot()

virtual void Cogs::Core::IRenderer::renderScreenshot ( const ScreenshotSettings settings,
std::vector< uint8_t > &  bytes,
uint32_t *  stride 
)
pure virtual

Render screenshot.

Implemented in Cogs::Core::Renderer.

◆ setBackgroundColor()

virtual void Cogs::Core::IRenderer::setBackgroundColor ( const glm::vec4 &  color)
pure virtual

Set the background color applied to the output surface before rendering.

Parameters
colorA four-component RGBA color to clear the surface to.

Implemented in Cogs::Core::Renderer.

◆ setMode()

virtual void Cogs::Core::IRenderer::setMode ( RenderMode  mode)
pure virtual

Set the rendering mode the renderer should use.

Parameters
modeRendering mode to use.
See also
RenderMode

Implemented in Cogs::Core::Renderer.

◆ unregisterExtension()

virtual void Cogs::Core::IRenderer::unregisterExtension ( IRendererExtension extension)
pure virtual

◆ updatePermutation()

virtual void Cogs::Core::IRenderer::updatePermutation ( EnginePermutation permutation)
pure virtual

Updates the EnginePermutation.

Parameters
permutationEnginePermutation to update.
See also
EnginePermutation

Implemented in Cogs::Core::Renderer.


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