yupplemayham/YuppleMayham/include/graphics/mesh.h

31 lines
489 B
C++

#ifndef _H_MESH_H
#define _H_MESH_H
#include <vector>
#include <thirdparty/glad/glad.h>
#include <glm/glm.hpp>
typedef struct {
glm::vec3 vertex;
glm::vec2 texCoord;
}Vertex;
typedef std::vector<Vertex> VertexList;
typedef std::vector<unsigned> IndexList;
class Mesh
{
public:
Mesh(const VertexList&, const IndexList& indexList);
~Mesh();
void draw();
private:
// Vertex Array, Vertex Buffer, Element Buffer
unsigned VAO, VBO, EBO;
size_t indexSize;
};
#endif // _H_MESH_H