Blackcomb  prealpha
Engine-ish
Mesh.h
1 #ifndef BLACKCOMB_MESH_H
2 #define BLACKCOMB_MESH_H
3 
4 #include <glad/glad.h>
5 #include <vector>
6 #include "../misc/Coords.h"
7 
8 namespace blackcomb::renderer {
12  struct Vertex {
13  misc::Point3f pos;
14  misc::Color color;
15  misc::UVCoord uv;
16  };
17 
21  class Mesh {
22  public:
23  Mesh(std::vector<GLfloat> modelData, std::vector<GLuint> indices);
24  Mesh(std::vector<Vertex>& vertices, std::vector<GLuint>& indices);
25  Mesh();
26  void cleanup();
27  void render();
28  GLuint vao = 0;
29  unsigned long numVerts, numIndices;
30  private:
31  GLuint ebo, vbo;
32  };
33 }
34 
35 #endif //BLACKCOMB_MESH_H
Represents a colour in the RGBA colour space.
Definition: Coords.h:77
Loads and stores mesh data.
Definition: Mesh.h:21
Holds the data that describes a vertex: position, colour, and uv coordinate.
Definition: Mesh.h:12
Represents a 3D point with floats.
Definition: Coords.h:54
Definition: Mesh.h:8
Represents a set of UV coordinates.
Definition: Coords.h:13