|
MochiEngine
|
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>
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< AbstractTextureFactory > | CreateTextureFactory (FS::PackCatalog *catalog) const =0 |
| Creates (without ownership) a texture factory of the type compatible with the renderer. | |
| virtual std::unique_ptr< AbstractGUI > | CreateGUI (FS::PackCatalog *catalog, Input::IActionManager *actionManager)=0 |
| Creates (without ownership) the GUI system compatible with the renderer. | |
| virtual std::unique_ptr< Debug::IGizmos > | CreateGizmos ()=0 |
| Creates (without ownership) a gizmos system compatible with the renderer. This system is only relevant on debug mode. | |
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.
|
pure virtual |
Creates (without ownership) a gizmos system compatible with the renderer. This system is only relevant on debug mode.
Implemented in Mochi::Graphics::DummyRenderer, and Mochi::Graphics::SDLRenderer.
|
pure virtual |
Creates (without ownership) the GUI system compatible with the renderer.
| catalog | The file catalog used for the GUI system to load files from. |
| actionManager | The action manager, used to manage UI interactions. |
Implemented in Mochi::Graphics::DummyRenderer, and Mochi::Graphics::SDLRenderer.
|
pure virtual |
Creates (without ownership) a texture factory of the type compatible with the renderer.
| catalog | The file catalog used for the factory to load files from. |
Implemented in Mochi::Graphics::DummyRenderer, and Mochi::Graphics::SDLRenderer.
|
pure virtual |
Finishes a frame rendering.
Implemented in Mochi::Graphics::DummyRenderer, and Mochi::Graphics::SDLRenderer.
|
pure virtual |
Actually renders the contents of the render queue projected on the camera.
| renderQueue | The vector of render commands to be drawn. |
| camera | The camera on which to project the rendering. |
Implemented in Mochi::Graphics::DummyRenderer, and Mochi::Graphics::SDLRenderer.
|
pure virtual |
Initializes a frame.
Implemented in Mochi::Graphics::DummyRenderer, and Mochi::Graphics::SDLRenderer.