learn-opengl/11-lightmaps/src/mesh.hpp
2026-08-21 13:15:55 -04:00

42 lines
755 B
C++

#pragma once
#include <glad/glad.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include "shader.hpp"
#include <string>
#include <vector>
struct Vertex {
glm::vec3 Position;
glm::vec3 Normal;
glm::vec2 TexCoords;
};
struct Texture {
unsigned int id;
std::string type;
std::string path;
};
struct Mesh {
std::vector<Vertex> vertices;
std::vector<unsigned int> indices;
std::vector<Texture> textures;
unsigned int VAO;
unsigned int VBO;
unsigned int EBO;
Mesh(std::vector<Vertex> vertices, std::vector<unsigned int> indices, std::vector<Texture> textures) :
vertices(vertices),
indices(indices),
textures(textures)
{
setupMesh();
}
void Draw(Shader &shader);
void setupMesh();
};