Commit of work up to day 11 of learnopengl.com.

This commit is contained in:
Zed A. Shaw 2026-08-21 13:15:55 -04:00
commit 5ce5b4dda4
447 changed files with 126678 additions and 0 deletions

42
11-lightmaps/src/mesh.hpp Normal file
View file

@ -0,0 +1,42 @@
#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();
};