Added model loading

This commit is contained in:
Robert 2021-01-30 04:02:15 +01:00
parent 707687b682
commit 8c62929e3c
24 changed files with 199852 additions and 23 deletions

43
include/model/mesh.hpp Normal file
View file

@ -0,0 +1,43 @@
#ifndef MESH_HPP
#define MESH_HPP
#include <vector>
#include <core.hpp>
#include <glm/glm.hpp>
#include <texture.hpp>
#include <shader.hpp>
#include <vertexArray.hpp>
namespace oglu
{
struct OGLU_API Vertex
{
glm::vec3 Position;
glm::vec3 Normal;
glm::vec2 UV;
};
class OGLU_API Mesh
{
public:
Mesh(const std::vector<Vertex>& vertices,
const std::vector<GLuint>& indices,
const std::vector<Texture>& textures);
void Render(Shader& shader);
private:
void CreateMesh();
public:
std::vector<Vertex> vertices;
std::vector<GLuint> indices;
std::vector<Texture> textures;
private:
VertexArray VAO;
};
}
#endif