Fireworks Engine  v2.0
Lightweight Sandbox Game Engine using OpenGL for additional Customisation and Quick Prototyping
fireworks::graphics::Layer Class Reference

Creates a Layer to hold a collection of renderables. More...

#include <layer.h>

Collaboration diagram for fireworks::graphics::Layer:

Public Member Functions

 Layer (Renderer2D *renderer)
 Create the layer by passing the renderer of your choice. More...
 
virtual ~Layer ()
 
virtual void add (Renderable2D *renderable)
 Use this to add the renderables to the layer. More...
 
virtual void render ()
 Renders all the renderables present in the layer. More...
 
const std::vector< Renderable2D * > & getRenderables ()
 Gets the list of renderables in the layer. More...
 

Public Attributes

Renderer2Dm_Renderer
 The renderer used the by the layer to render the renderables. More...
 
std::vector< Renderable2D * > m_Renderables
 The collection of renderables rendered by the layer. More...
 

Detailed Description

Creates a Layer to hold a collection of renderables.

Add the renderables such as Sprite to the layer and automatically submit it to the render queue to render them using the renderer of your choice

Constructor & Destructor Documentation

◆ Layer()

fireworks::graphics::Layer::Layer ( Renderer2D renderer)

Create the layer by passing the renderer of your choice.

Parameters
rendererThe render of your choice
See also
Renderer2D for more information of the renderer's available

◆ ~Layer()

fireworks::graphics::Layer::~Layer ( )
virtual

Member Function Documentation

◆ add()

void fireworks::graphics::Layer::add ( Renderable2D renderable)
virtual

Use this to add the renderables to the layer.

◆ getRenderables()

const std::vector<Renderable2D*>& fireworks::graphics::Layer::getRenderables ( )
inline

Gets the list of renderables in the layer.

Returns
A reference to list of renderables present in the layer

◆ render()

void fireworks::graphics::Layer::render ( )
virtual

Renders all the renderables present in the layer.

Member Data Documentation

◆ m_Renderables

std::vector<Renderable2D*> fireworks::graphics::Layer::m_Renderables

The collection of renderables rendered by the layer.

◆ m_Renderer

Renderer2D* fireworks::graphics::Layer::m_Renderer

The renderer used the by the layer to render the renderables.


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