Anim 0.1
Loading...
Searching...
No Matches
primitive_renderer.h
1#ifndef _PRIMITIVE_RENDERER_H
2#define _PRIMITIVE_RENDERER_H
3
4#include <gef.h>
5
6namespace gef
7{
8 class Platform;
9 class Renderer3D;
10 class Vector4;
11 class Colour;
12 class VertexBuffer;
13 class IndexBuffer;
14}
15
16
17
18namespace GefExtensions
19{
20 class VertexColourUnlitShader;
22 {
23 public:
24 PrimitiveRenderer(gef::Platform & platform, UInt32 max_num_lines = kDefaultMaxNumLines, UInt32 max_num_triangles = kDefaultMaxNumTriangles);
26
27 void Render(gef::Renderer3D & renderer_3d);
28
29 void Reset();
30
31 void AddLine(gef::Vector4 const & start, gef::Vector4 const & end, gef::Colour const & colour);
32 void AddTriangle(gef::Vector4 const & v0, gef::Vector4 const & v1, gef::Vector4 const & v2, gef::Colour const & colour);
33
34 void DrawLines(gef::Renderer3D & renderer3D);
35 void DrawTriangles(gef::Renderer3D & renderer3D);
36
37 static int constexpr kDefaultMaxNumLines = 512;
38 static int constexpr kDefaultMaxNumTriangles = 512;
39 private:
41 UInt32 num_lines_;
42 UInt32 num_triangles_;
43 gef::VertexBuffer * lines_vertex_buffer_;
44 gef::VertexBuffer * triangles_vertex_buffer_;
45 gef::IndexBuffer * lines_index_buffer_;
46 gef::IndexBuffer * triangles_index_buffer_;
47 UInt32 max_num_lines_;
48 UInt32 max_num_triangles_;
49 };
50}
51#endif // _PRIMITIVE_RENDERER_H
Definition: primitive_renderer.h:22
Definition: vertex_colour_unlit_shader.h:19