Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
Renderer Class Referencefinal

Service responsible for rendering game objects to the screen. More...

#include <renderer.h>

Inheritance diagram for Renderer:
[legend]

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.
 
Windowwindow ()
 
- Public Member Functions inherited from IEngineService
virtual ~IEngineService ()=default
 

Friends

class RenderingManager
 
class AssetService
 
class SdlStrategyFactory
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Renderer() [1/2]

Renderer::Renderer ( )
explicit

◆ Renderer() [2/2]

Renderer::Renderer ( int  min_aspect_width,
int  min_aspect_height,
const std::string &  title,
RendererFlags  flags 
)
explicit

Member Function Documentation

◆ clear()

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.

◆ render()

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.

Parameters
objectsA map of renderable objects grouped by their rendering layer
sceneThe current scene being rendered

◆ vsync() [1/2]

bool Renderer::vsync ( ) const

Checks if vertical synchronization (VSync) is enabled.

Returns
true if VSync is enabled, false otherwise.

◆ vsync() [2/2]

void Renderer::vsync ( bool  enabled)

Toggles vertical synchronization (VSync) which limits fps to the monitor's refresh rate.

◆ window()

Window & Renderer::window ( )

Friends And Related Symbol Documentation

◆ AssetService

friend class AssetService
friend

◆ RenderingManager

friend class RenderingManager
friend

◆ SdlStrategyFactory

friend class SdlStrategyFactory
friend

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