Fireworks Engine  v2.0
Lightweight Sandbox Game Engine using OpenGL for additional Customisation and Quick Prototyping
shotrenderer3d.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "renderer3d.h"
4 #include "../renderables/renderable3d.h"
5 
6 // GLM
7 #include <glm/glm.hpp>
8 #include <glm/gtc/matrix_transform.hpp>
9 #include <glm/gtc/type_ptr.hpp>
10 #include <glm/gtx/string_cast.hpp>
11 
12 namespace fireworks { namespace graphics {
13 
14 #define SHOT_RENDERER3D_MAX_PRIMITIVES 1
15 #define SHOT_RENDERER3D_VERTEX_SIZE sizeof(VertexData3D)
16 #define SHOT_RENDERER3D_DEFAULT_FACES 6
17 #define SHOT_RENDERER3D_PRIMITIVE_SIZE SHOT_RENDERER3D_VERTEX_SIZE * SHOT_RENDERER3D_DEFAULT_FACES * 4
18 #define SHOT_RENDERER3D_BUFFER_SIZE SHOT_RENDERER3D_PRIMITIVE_SIZE * SHOT_RENDERER3D_MAX_PRIMITIVES
19 #define SHOT_RENDERER3D_INDICES_SIZE SHOT_RENDERER3D_MAX_PRIMITIVES * SHOT_RENDERER3D_DEFAULT_FACES * 6
20 
24  class ShotRenderer3D : public Renderer3D
25  {
26  private:
27  GLuint m_VAO;
28  GLuint m_VBO;
29  VertexData3D* m_Buffer;
30  IndexBuffer* m_IBO;
31  GLsizei m_IndicesCount;
32  GLuint m_Texture;
33  public:
39 
41  void begin() override;
43  void submit(const Renderable3D* renderable) override;
45  void end() override;
47  void flush() override;
48  private:
49  void init();
50  };
51 
52 } }
53 
ShotRenderer3D(PerspectiveCamera *camera)
Creates the ShotRenderer with a camera target to render to.
Definition: shotrenderer3d.cpp:5
Creates Index Buffers.
Definition: indexbuffer.h:11
The vertex structure of a 3D primitive.
Definition: renderable3d.h:16
The Class responsible for drawing the basic 3D Renderable objects onto the screen.
Definition: renderable3d.h:66
Definition: audioclip.cpp:3
void end() override
Ends the submission and prepares the renderer to start drawing.
Definition: shotrenderer3d.cpp:91
void submit(const Renderable3D *renderable) override
Begins to submit the renderables to render queue.
Definition: shotrenderer3d.cpp:59
void begin() override
Begins the rendering process.
Definition: shotrenderer3d.cpp:53
Forward declaration of the graphics::Renderable3D.
Definition: renderer3d.h:16
~ShotRenderer3D()
Definition: shotrenderer3d.cpp:11
Renders the 3D renderables on a per draw call basis.
Definition: shotrenderer3d.h:24
void flush() override
Draws the data processed onto the screen.
Definition: shotrenderer3d.cpp:97
A perspective camera to view objects in perspective projection.
Definition: perspectivecamera.h:16