-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMesh.h
More file actions
68 lines (45 loc) · 1.49 KB
/
Mesh.h
File metadata and controls
68 lines (45 loc) · 1.49 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef MESH_H
#define MESH_H
/************************************************************************
Mesh is just a container for mesh data. It does not implement any
functionality in itself except for getting and setting its values.
All functionality is implemented by MeshManager which is also responsible
for loading and returning meshes to object which utilize them.
************************************************************************/
#include <GL/glew.h>
#include <glm/glm.hpp>
#include "Material.h"
struct vertex {
glm::vec3 position;
glm::vec3 normal;
glm::vec2 texcoords;
glm::vec3 tangent;
};
class Mesh {
public:
Mesh(unsigned int vertexCount, vertex* vertexArray, unsigned int indexCount, GLuint* indexArray, Material* material, GLuint usage = GL_STATIC_DRAW);
~Mesh();
unsigned int getVertexCount() const;
unsigned int getIndexCount() const;
unsigned int getTriCount() const;
Material* getMaterial();
void setMaterial(Material* material);
//vertex* getVertexArray() const;
//GLuint* getIndexArray() const;
//void setVertexArray(unsigned int vertCount, vertex* vertexArray);
//void setIndexArray(unsigned int indicesCount, GLuint* indexArray);
GLuint getVertexBufferID() const;
GLuint getIndexBufferID() const;
//bool isDummy();
private:
unsigned int m_iVertexCount;
//vertex* m_xVertices;
unsigned int m_iIndexCount;
//GLuint* m_iIndices;
Material* m_xMaterial;
struct meshBufferIDs {
GLuint vertex;
GLuint index;
} m_xGLBuffers;
};
#endif