feat: refactor code + optimizations for obj file parsing

This commit is contained in:
2025-10-01 17:55:29 +02:00
parent 2b0494a23d
commit fc91f6662e
10 changed files with 510 additions and 235 deletions

27
include/renderer/mesh.h Normal file
View File

@ -0,0 +1,27 @@
#ifndef MESH_H_
#define MESH_H_
#include <vector>
#include <string>
#include <GL/glew.h>
#include "renderer/basics.h"
class Mesh {
public: // TODO: abstract away
unsigned int m_vao, m_vbo, m_ebo;
std::vector<Vertex> m_vertexBuffer;
std::vector<unsigned int> m_indexBuffer;
public: // TODO: abstract away
void Bind() { glBindVertexArray(m_vao); }
void Unbind() { glBindVertexArray(0); }
void Upload();
public:
std::string materialName;
public:
Mesh();
public:
void Render();
};
#endif // MESH_H_