TazGraph Project
v0.1.0
Loading...
Searching...
No Matches
TazGraphEngine
Renderers
PlaneRenderers
PlaneColorRenderer
PlaneColorRenderer.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
// init --_
11
// `-->begin()
12
// |
13
// | --> draw()
14
// | --> draw()
15
// |
16
// |--> end()
17
// `--> renderBatch()
18
19
class
PlaneColorRenderer
:
public
PlaneRenderer
{
20
public
:
21
PlaneColorRenderer
();
22
~PlaneColorRenderer
();
23
24
void
init();
25
26
void
begin();
27
void
end();
28
29
void
initBatchSize();
30
31
void
drawTriangle(
size_t
v_index,
32
const
glm::vec3& depth,
33
const
glm::vec3& cpuRotation,
const
Color
& color);
34
35
void
draw
(
size_t
v_index,
36
const
glm::vec2& rectSize,
37
const
glm::vec3& bodyCenter,
38
const
glm::vec3& mRotation,
39
const
Color
& color);
40
41
void
drawBox(
size_t
v_index,
42
const
glm::vec3& boxSize,
43
const
glm::vec3& bodyCenter,
44
const
glm::vec3& mRotation,
45
const
Color
& color);
46
47
void
drawSphere(
size_t
v_index,
48
const
glm::vec3& sphereSize,
49
const
glm::vec3& bodyCenter,
50
const
glm::vec3& mRotation,
51
const
Color
& color);
52
53
void
renderBatch(
GLSLProgram
* glsl_program);
54
55
void
dispose();
56
57
std::vector<Position> sphereVertices = {
58
// Generated vertices will go here
59
};
60
61
std::vector<GLuint> sphereIndices = {
62
// Generated indices will go here
63
};
64
65
private
:
66
void
createInstancesVBO();
67
void
createVertexArray();
68
69
std::vector<ColorMeshRenderer> _meshesArrays;
70
std::vector<ColorMeshRenderer> _meshesElements;
71
72
};
GLSLProgram
Definition
GLSLProgram.h:306
PlaneColorRenderer
Definition
PlaneColorRenderer.h:19
PlaneColorRenderer::draw
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
PlaneColorRenderer.cpp:72
PlaneRenderer
Definition
PlaneRenderer.h:20
Color
Definition
Vertex.h:47
Generated by
1.9.8