-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMesh.h
46 lines (30 loc) · 785 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
#ifndef LEARNINGOPENGL_MESH_H
#define LEARNINGOPENGL_MESH_H
#include <vector>
#include "Shader.h"
#include "Texture.h"
#include "Vertex.h"
class Mesh {
public:
Mesh();
bool createTetrahedron();
bool createCube();
bool createOctahedron();
bool createTorus();
void useTexturesOf(const Mesh &mesh);
void attachTextures(const Shader &shader) const;
void drawArrays() const;
void drawElements() const;
void dispose();
private:
bool loadTextures();
void loadVertexArray();
std::vector<Vertex> vertices;
std::vector<unsigned int> indices;
std::vector<Texture> textures;
unsigned int vertexArray;
unsigned int vertexBuffer;
unsigned int elementBuffer;
bool isLoaded;
};
#endif //LEARNINGOPENGL_MESH_H