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

Renders the renderables in a single draw call using batching. More...

#include <batchrenderer2d.h>

Inheritance diagram for fireworks::graphics::BatchRenderer2D:
Collaboration diagram for fireworks::graphics::BatchRenderer2D:

Public Member Functions

 BatchRenderer2D (Camera2D *camera2D, Shader *shader)
 Creates the batch renderer. More...
 
 ~BatchRenderer2D ()
 
void begin () override
 Begins the rendering process. More...
 
void submit (const Renderable2D *renderable) override
 Begins to submit the renderables to render queue. More...
 
void end () override
 Ends the submission and prepares the renderer to start drawing. More...
 
void flush () override
 Draws the data processed onto the screen. More...
 
- Public Member Functions inherited from fireworks::graphics::Renderer2D
void push (const glm::mat4 &matrix, bool override=false)
 Pushes the transformation matrix to transform the renderables if using groups. More...
 
void pop ()
 Pops the transformation matrix to transform the renderables if using groups. More...
 
virtual ~Renderer2D ()
 

Public Attributes

Shaderm_Shader
 The shader with which the batch will be rendered with. More...
 
- Public Attributes inherited from fireworks::graphics::Renderer2D
Camera2Dm_Camera2D
 The camera to which the renderers out will be displayed to. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fireworks::graphics::Renderer2D
 Renderer2D (Camera2D *camera2D)
 Creates the renderer using the camera. More...
 
- Protected Attributes inherited from fireworks::graphics::Renderer2D
std::vector< glm::mat4 > m_TransformationStack
 The transformation matrix stack that keeps track of relative transformation matrix of the groups. More...
 
const glm::mat4 * m_TransformationBack
 The transformation matrix to renders stuff relative to one another aka if using groups. More...
 

Detailed Description

Renders the renderables in a single draw call using batching.

Constructor & Destructor Documentation

◆ BatchRenderer2D()

fireworks::graphics::BatchRenderer2D::BatchRenderer2D ( Camera2D camera2D,
Shader shader 
)

Creates the batch renderer.

Parameters
camera2DThe graphics::Camera2D to which the rendered view will be relayed to
shaderThe shader with which the batch will be rendered with
See also
graphics::Camera2D for more information on creating the camera
graphics::shader for more informatoin of creating shaders

◆ ~BatchRenderer2D()

fireworks::graphics::BatchRenderer2D::~BatchRenderer2D ( )

Member Function Documentation

◆ begin()

void fireworks::graphics::BatchRenderer2D::begin ( )
overridevirtual

Begins the rendering process.

Reimplemented from fireworks::graphics::Renderer2D.

◆ end()

void fireworks::graphics::BatchRenderer2D::end ( )
overridevirtual

Ends the submission and prepares the renderer to start drawing.

Reimplemented from fireworks::graphics::Renderer2D.

◆ flush()

void fireworks::graphics::BatchRenderer2D::flush ( )
overridevirtual

Draws the data processed onto the screen.

Implements fireworks::graphics::Renderer2D.

◆ submit()

void fireworks::graphics::BatchRenderer2D::submit ( const Renderable2D renderable)
overridevirtual

Begins to submit the renderables to render queue.

Implements fireworks::graphics::Renderer2D.

Member Data Documentation

◆ m_Shader

Shader* fireworks::graphics::BatchRenderer2D::m_Shader

The shader with which the batch will be rendered with.


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