|
Capycore Engine
0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
|
Service responsible for rendering game objects to the screen. More...
#include <renderer.h>
Public Member Functions | |
| Renderer () | |
| Renderer (int min_aspect_width, int min_aspect_height, const std::string &title, RendererFlags flags) | |
| void | render (const std::map< int, std::multimap< int, std::reference_wrapper< Renderable > > > &objects, const Scene &scene) |
| Renders a collection of game objects to the screen. Renders a given collection of game objects to the screen. Each game object is expected to have its own sprite, or it will be skipped. Mind that this method clears the entire screen and renders immediately on finish. If you want to batch multiple calls, fuse them into one. | |
| bool | vsync () const |
| Checks if vertical synchronization (VSync) is enabled. | |
| void | vsync (bool enabled) |
| Toggles vertical synchronization (VSync) which limits fps to the monitor's refresh rate. | |
| void | clear () const |
| Clears the rendering target with the drawing color. Clears the current rendering target with the drawing color set in the SDL renderer. | |
| Window & | window () |
Public Member Functions inherited from IEngineService | |
| virtual | ~IEngineService ()=default |
Friends | |
| class | RenderingManager |
| class | AssetService |
| class | SdlStrategyFactory |
Service responsible for rendering game objects to the screen.
The Renderer class encapsulates the SDL rendering context and provides methods to render game objects, clear the screen, and manage the rendering window.
|
explicit |
|
explicit |
| void Renderer::clear | ( | ) | const |
Clears the rendering target with the drawing color. Clears the current rendering target with the drawing color set in the SDL renderer.
| void Renderer::render | ( | const std::map< int, std::multimap< int, std::reference_wrapper< Renderable > > > & | objects, |
| const Scene & | scene | ||
| ) |
Renders a collection of game objects to the screen. Renders a given collection of game objects to the screen. Each game object is expected to have its own sprite, or it will be skipped.
Mind that this method clears the entire screen and renders immediately on finish. If you want to batch multiple calls, fuse them into one.
| objects | A map of renderable objects grouped by their rendering layer |
| scene | The current scene being rendered |
| bool Renderer::vsync | ( | ) | const |
Checks if vertical synchronization (VSync) is enabled.
| void Renderer::vsync | ( | bool | enabled | ) |
Toggles vertical synchronization (VSync) which limits fps to the monitor's refresh rate.
| Window & Renderer::window | ( | ) |
|
friend |
|
friend |
|
friend |