-
Notifications
You must be signed in to change notification settings - Fork 1
/
Mesh.h
47 lines (37 loc) · 865 Bytes
/
Mesh.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// Created by debowin on 11/13/17.
//
#ifndef GAMEGL_MESH_H
#define GAMEGL_MESH_H
#include "glm/glm.hpp"
#include "glad/glad.h"
#include "obj_loader.h"
#include <string>
class Vertex {
public:
glm::vec3 pos;
glm::vec2 texCoord;
glm::vec3 normal;
Vertex(const glm::vec3 &pos, const glm::vec2 &texCoord, const glm::vec3 &normal);
};
class Mesh {
enum{
POSITION_VB,
TEXCOORD_VB,
NORMAL_VB,
INDEX_VB,
NUM_BUFFERS
};
GLuint m_vertexArrayObject;
GLuint m_vertexBufferObjects[NUM_BUFFERS];
uint m_drawCount;
void LoadMesh(IndexedModel &model);
public:
Mesh(std::string fileName);
Mesh(Vertex* vertices, uint numVertices, uint* indices, uint numIndices);
Mesh();
void Draw();
void InitMesh(std::string fileName);
virtual ~Mesh();
};
#endif //GAMEGL_MESH_H