18 std::vector<glm::vec3> vertex{};
20 std::vector<glm::vec4> colors{};
22 std::vector<unsigned int> index{};
24 std::vector<glm::vec2> texCoords{};
26 std::vector<glm::vec3> normals{};
28 std::vector<unsigned int> ids{};
30 std::vector<glm::mat4> modelOffset{};
32 std::vector<glm::vec4> colorOffset{};
54 void appendSphere(
const unsigned int &
id,
const glm::mat4 &model,
const glm::vec4 &color);
55 void appendCube(
const unsigned int &
id,
const glm::mat4 &model,
const glm::vec4 &color);
56 void appendPyramid(
const unsigned int &
id,
const glm::mat4 &model,
const glm::vec4 &color);
57 void appendThorus(
const unsigned int &
id,
const glm::mat4 &model,
const glm::vec4 &color);
59 void drawArrays(
const unsigned int &vao,
const unsigned int &mode,
const int &first,
const size_t &size);
61 void drawElements(
const unsigned int &vao,
const unsigned int &mode,
const size_t &size,
const unsigned int &type,
const void *indices = 0);
63 void drawAllInstanced();
65 void prepareBuffers(
const std::vector<glm::mat4> &models,
const std::vector<glm::vec4> &colors);
67 RendererStats getRendererStats()
const {
return this->m_stats; }
69 void resetDrawStats() {
70 this->m_stats.numCubes = 0;
71 this->m_stats.numPyramids = 0;
72 this->m_stats.numSpheres = 0;
73 this->m_stats.numThorus = 0;
76 Renderer(Renderer &other) =
delete;
78 void operator=(
const Renderer &other) =
delete;
80 inline static Shared<Renderer> instance() {
81 if (s_pointer ==
nullptr) {
82 Shared<Renderer> copy(
new Renderer());
88 ~Renderer() =
default;
93 inline static Shared<Renderer> s_pointer =
nullptr;