Starting the refactor session on day 14. Moved the glad and KHR dirs into src to start.

This commit is contained in:
Zed A. Shaw 2026-08-24 12:13:03 -04:00
parent 1b7066757a
commit 5b5e8a9fb0
62 changed files with 13880 additions and 0 deletions

42
14-refactor/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();
};