TazGraph Project v0.1.0
Loading...
Searching...
No Matches
LightRenderer.h
1#pragma once
2
3#include <GL/glew.h>
4#include <glm/glm.hpp>
5#include <vector>
6
7#include "../../../GLSLProgram.h"
8#include "../PlaneRenderer.h"
9
10
11// init --_
12// `-->begin()
13// |
14// | --> draw()
15// | --> draw()
16// |
17// |--> end()
18// `--> renderBatch()
19
21public:
24
25 void init();
26
27 void begin();
28 void end();
29
30 void initBatchSize();
31
32 void drawTriangle(size_t v_index,
33 const glm::vec3& depth,
34 const glm::vec3& cpuRotation, const Color& color);
35
36 void draw(size_t v_index,
37 const glm::vec2& rectSize,
38 const glm::vec3& bodyCenter,
39 const glm::vec3& mRotation,
40 const Color& color);
41
42 void drawBox(size_t v_index,
43 const glm::vec3& boxSize,
44 const glm::vec3& bodyCenter,
45 const glm::vec3& mRotation,
46 const Color& color);
47
48 void drawSphere(size_t v_index,
49 const glm::vec3& sphereSize,
50 const glm::vec3& bodyCenter,
51 const glm::vec3& mRotation,
52 const Color& color);
53
54
55 void renderBatch(GLSLProgram* glsl_program);
56
57 void dispose();
58
59 std::vector<LightVertex> sphereVertices = {
60 // Generated vertices will go here
61 };
62
63 std::vector<GLuint> sphereIndices = {
64 // Generated indices will go here
65 };
66
67private:
68 void createInstancesVBO();
69 void createVertexArray();
70
71 std::vector<ColorMeshRenderer> _meshesArrays;
72 std::vector<ColorMeshRenderer> _meshesElements;
73
74};
Definition GLSLProgram.h:306
Definition LightRenderer.h:20
void draw(size_t v_index, const glm::vec2 &rectSize, const glm::vec3 &bodyCenter, const glm::vec3 &mRotation, const Color &color)
draws are needed to convert the pos and size to vertices
Definition LightRenderer.cpp:72
Definition PlaneRenderer.h:20
Definition Vertex.h:47