TazGraph Project
v0.1.0
Loading...
Searching...
No Matches
RenderEngine
src
Renderers
PlaneRenderers
PlaneColorRenderer
PlaneColorRenderer.h
1
#pragma once
2
3
#include "../../Renderer.h"
4
5
// init --_
6
// `-->begin()
7
// |
8
// | --> draw()
9
// | --> draw()
10
// |
11
// |--> end()
12
// `--> renderBatch()
13
14
class
PlaneColorRenderer
:
public
Taz::Renderer
{
15
public
:
16
PlaneColorRenderer
();
17
~PlaneColorRenderer
();
18
19
void
init();
20
21
void
begin();
22
23
void
initBatch
(
Taz::RenderBatch
& batch);
24
25
void
drawTriangle(
26
size_t
v_index,
27
const
glm::vec3& depth,
28
const
glm::vec3& size,
29
const
glm::vec3& cpuRotation,
30
const
TazColor
& color);
31
32
void
draw
(
size_t
v_index,
33
const
glm::vec2& rectSize,
34
const
glm::vec3& position,
35
const
glm::vec3& mRotation,
36
const
TazColor
& color);
37
38
void
drawBox(
size_t
v_index,
39
const
glm::vec3& boxSize,
40
const
glm::vec3& position,
41
const
glm::vec3& mRotation,
42
const
TazColor
& color);
43
44
void
drawSphere(
size_t
v_index,
45
const
glm::vec3& sphereSize,
46
const
glm::vec3& position,
47
const
glm::vec3& mRotation,
48
const
TazColor
& color);
49
50
void
endBatch(
const
Taz::RenderBatch
& batch)
override
;
51
52
void
dispose();
53
54
std::vector<TazPosition> sphereVertices = {
55
// Generated vertices will go here
56
};
57
58
std::vector<GLuint> sphereIndices = {
59
// Generated indices will go here
60
};
61
62
private
:
63
void
createInstancesVBO();
64
void
createVertexArray();
65
66
std::vector<ColorMeshRenderer> _meshesArrays;
67
std::vector<ColorMeshRenderer> _meshesElements;
68
69
size_t
currentBatchIndex = 0;
70
71
};
PlaneColorRenderer
Definition
PlaneColorRenderer.h:14
PlaneColorRenderer::initBatch
void initBatch(Taz::RenderBatch &batch)
Definition
PlaneColorRenderer.cpp:34
PlaneColorRenderer::draw
void draw(size_t v_index, const glm::vec2 &rectSize, const glm::vec3 &position, const glm::vec3 &mRotation, const TazColor &color)
draws are needed to convert the pos and size to vertices
Definition
PlaneColorRenderer.cpp:87
Taz::Renderer
Definition
Renderer.h:51
TazGraphEngine::Color
Definition
Vertex.h:44
Taz::RenderBatch
Definition
Renderer.h:19
Generated by
1.9.8