5#include "../../util/position.hpp"
7#include "../../shapes/shapes.hpp"
11#include "../shader.hpp"
Batches and draws untextured geometric primitives.
Definition primitive_renderer.hpp:21
VBO vbo
Vertex buffer holding the batched data.
Definition primitive_renderer.hpp:26
Shader * shader
Shader used to draw the primitives.
Definition primitive_renderer.hpp:27
void beginFrame()
Resets the batch at the start of a frame.
Definition primitive_renderer.cpp:40
void endFrame()
Flushes the accumulated batch to the GPU.
Definition primitive_renderer.cpp:45
static PrimitiveRenderer * instance
Singleton instance.
Definition primitive_renderer.hpp:23
std::vector< Vertex > vertices
Accumulated vertices for the current frame.
Definition primitive_renderer.hpp:24
void draw(const Triangle &t)
Adds a triangle to the current batch.
Definition primitive_renderer.cpp:56
VAO vao
Vertex array describing the layout.
Definition primitive_renderer.hpp:25
void setShader(Shader *shader)
Replaces the shader used for drawing.
Definition primitive_renderer.cpp:68
Wraps a compiled and linked OpenGL shader program.
Definition shader.hpp:61
Wraps an OpenGL Vertex Array Object.
Definition vao.hpp:12
Wraps an OpenGL Vertex Buffer Object.
Definition vbo.hpp:11
Definition audiomanager.cpp:4
An axis-aligned rectangle with a position, size and color.
Definition rectangle.hpp:21
A triangle defined by three vertices.
Definition triangle.hpp:14