MochiEngine
Loading...
Searching...
No Matches
Mochi::Graphics::IRenderer Class Referenceabstract

This interface provides means to show graphics in the game and create the subsystems needed to create textures for the same renderer and GUI using the same renderer. More...

#include <IRenderer.h>

Inheritance diagram for Mochi::Graphics::IRenderer:
Mochi::Graphics::DummyRenderer Mochi::Graphics::SDLRenderer

Public Member Functions

virtual void StartFrameRendering () const =0
 Initializes a frame.
virtual void Render (std::vector< RenderCommand > renderQueue, Camera *camera) const =0
 Actually renders the contents of the render queue projected on the camera.
virtual void FinishRendering () const =0
 Finishes a frame rendering.
virtual std::unique_ptr< AbstractTextureFactoryCreateTextureFactory (FS::PackCatalog *catalog) const =0
 Creates (without ownership) a texture factory of the type compatible with the renderer.
virtual std::unique_ptr< AbstractGUICreateGUI (FS::PackCatalog *catalog, Input::IActionManager *actionManager)=0
 Creates (without ownership) the GUI system compatible with the renderer.
virtual std::unique_ptr< Debug::IGizmosCreateGizmos ()=0
 Creates (without ownership) a gizmos system compatible with the renderer. This system is only relevant on debug mode.

Detailed Description

This interface provides means to show graphics in the game and create the subsystems needed to create textures for the same renderer and GUI using the same renderer.

The interface provides separate methods for rendering to meet the needs of different kind of renderers (initialize, load to gpu, present, for example).

Even if a single renderer is only planed to be used (in this case, SDL) this interface is still useful to inject a DummyRenderer on Tests and be able to do integration tests without graphics.

Member Function Documentation

◆ CreateGizmos()

virtual std::unique_ptr< Debug::IGizmos > Mochi::Graphics::IRenderer::CreateGizmos ( )
pure virtual

Creates (without ownership) a gizmos system compatible with the renderer. This system is only relevant on debug mode.

Returns
A unique pointer to the created gizmos system.

Implemented in Mochi::Graphics::DummyRenderer, and Mochi::Graphics::SDLRenderer.

◆ CreateGUI()

virtual std::unique_ptr< AbstractGUI > Mochi::Graphics::IRenderer::CreateGUI ( FS::PackCatalog * catalog,
Input::IActionManager * actionManager )
pure virtual

Creates (without ownership) the GUI system compatible with the renderer.

Parameters
catalogThe file catalog used for the GUI system to load files from.
actionManagerThe action manager, used to manage UI interactions.
Returns
A unique pointer to the created gui system.

Implemented in Mochi::Graphics::DummyRenderer, and Mochi::Graphics::SDLRenderer.

◆ CreateTextureFactory()

virtual std::unique_ptr< AbstractTextureFactory > Mochi::Graphics::IRenderer::CreateTextureFactory ( FS::PackCatalog * catalog) const
pure virtual

Creates (without ownership) a texture factory of the type compatible with the renderer.

Parameters
catalogThe file catalog used for the factory to load files from.
Returns
A unique pointer to the created texture factory.

Implemented in Mochi::Graphics::DummyRenderer, and Mochi::Graphics::SDLRenderer.

◆ FinishRendering()

virtual void Mochi::Graphics::IRenderer::FinishRendering ( ) const
pure virtual

Finishes a frame rendering.

Implemented in Mochi::Graphics::DummyRenderer, and Mochi::Graphics::SDLRenderer.

◆ Render()

virtual void Mochi::Graphics::IRenderer::Render ( std::vector< RenderCommand > renderQueue,
Camera * camera ) const
pure virtual

Actually renders the contents of the render queue projected on the camera.

Parameters
renderQueueThe vector of render commands to be drawn.
cameraThe camera on which to project the rendering.

Implemented in Mochi::Graphics::DummyRenderer, and Mochi::Graphics::SDLRenderer.

◆ StartFrameRendering()

virtual void Mochi::Graphics::IRenderer::StartFrameRendering ( ) const
pure virtual

Initializes a frame.

Implemented in Mochi::Graphics::DummyRenderer, and Mochi::Graphics::SDLRenderer.


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