-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mesh.hpp
50 lines (38 loc) · 841 Bytes
/
Mesh.hpp
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
#pragma once
#include <GL/glew.h>
#include <vector>
#include <map>
#include <string>
#include "Shader.hpp"
#include "vitiTypes.hpp"
/*
namespace vitiGL {
struct vertexHandler {
GLuint vbo;
GLuint vao;
//GLuint ebo;
};
class MeshCache {
public:
MeshCache();
~MeshCache();
void load(const std::string& meshName);
private:
static std::map<std::string, vertexHandler> _meshCache;
};
class Mesh {
public:
Mesh();
virtual ~Mesh();
virtual void draw(const Shader& shader) const;
protected:
virtual void initVertices(std::vector<Vertex>& vertices);
virtual void uploadVertices(const std::vector<Vertex>& vertices);
virtual void calcNormals(std::vector<Vertex>& vertices);
virtual void calcTangents(std::vector<Vertex>& vertices, bool bitangents = true);
GLuint _vao;
GLuint _vbo;
int numVertices;
bool invert;
};
}*/