AGL
A graphics library
triangle_mesh.h
1 // Copyright, 2020, Savvy Sine, Aline Normoyle
2 #ifndef AGL_MESH_TRIANGLE_MESH_H_
3 #define AGL_MESH_TRIANGLE_MESH_H_
4 
5 #include <vector>
6 #include "agl/mesh.h"
7 
8 namespace agl {
9 
16 class TriangleMesh : public Mesh {
17  public:
25  virtual void render() const;
26 
27  protected:
28  GLuint _nIndices = 0; // Number of triangle vertices
29 
36  void initBuffers(
37  std::vector<GLuint>* indices,
38  std::vector<GLfloat>* points,
39  std::vector<GLfloat>* normals,
40  std::vector<GLfloat>* texCoords = nullptr,
41  std::vector<GLfloat>* tangents = nullptr);
42 };
43 
44 } // namespace agl
45 #endif // AGL_MESH_TRIANGLE_MESH_H_
agl::TriangleMesh::render
virtual void render() const
Draw this mesh.
Definition: triangle_mesh.cpp:106
agl::TriangleMesh
Base class for indexed triangle meshes.
Definition: triangle_mesh.h:16
agl::TriangleMesh::initBuffers
void initBuffers(std::vector< GLuint > *indices, std::vector< GLfloat > *points, std::vector< GLfloat > *normals, std::vector< GLfloat > *texCoords=nullptr, std::vector< GLfloat > *tangents=nullptr)
Call initBuffers from init() to set the data for this mesh.
Definition: triangle_mesh.cpp:9
agl::Mesh
Base class for meshes.
Definition: mesh.h:18