-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModel.hpp
More file actions
44 lines (34 loc) · 728 Bytes
/
Model.hpp
File metadata and controls
44 lines (34 loc) · 728 Bytes
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
//
// Created by adamyuan on 4/18/18.
//
#ifndef SCENETEST_SCENE_HPP
#define SCENETEST_SCENE_HPP
#include <mygl3/vertexobject.hpp>
#include <mygl3/texture.hpp>
#include <mygl3/shader.hpp>
#include <mygl3/utils/camera.hpp>
#include <vector>
#include <unordered_map>
struct Vertex
{
glm::vec3 position, normal;
glm::vec2 texcoords;
};
struct Mesh
{
GLuint diffuse_texture;
mygl3::VertexObject<false> object;
std::vector<Vertex> vertices;
void Load();
};
class Model
{
private:
std::vector<Mesh> meshes_;
std::unordered_map<std::string, mygl3::Texture2D> textures_;
GLuint load_texture(const std::string &filename);
public:
void Load(const char *filename);
void Render() const;
};
#endif //SCENETEST_SCENE_HPP