feat: refactoring

This commit is contained in:
2025-10-22 14:25:02 +02:00
parent 71f1b2c6d2
commit ea593feb8d
36 changed files with 220 additions and 71 deletions

View File

@ -3,6 +3,8 @@
#include <glm/glm.hpp>
namespace Engine {
class Vertex {
friend class Mesh;
private:
@ -14,4 +16,6 @@ public:
: m_position(position), m_normal(normal), m_texCoord(texCoord) {}
};
}
#endif // RENDERER_BASICS_H

View File

@ -13,6 +13,8 @@
#include "engine/app/app.h"
#include "engine/export.h"
namespace Engine {
class ENGINE_API Engine : public EventHandler {
public:
static Engine* GetInstance();
@ -31,5 +33,6 @@ private:
bool m_running;
};
}
#endif // ENGINE_H_

View File

@ -3,6 +3,8 @@
#include <GL/glew.h>
namespace Engine {
void MessageCallback(GLenum source,
GLenum type,
GLuint id,
@ -11,4 +13,6 @@ void MessageCallback(GLenum source,
const GLchar* message,
const void* userParam);
}
#endif // RENDERER_DEBUG_

View File

@ -6,6 +6,8 @@
#include "engine/renderer/texture.h"
namespace Engine {
class Material {
private:
glm::vec3 m_ambient { 0.2f, 0.2f, 0.2f };
@ -39,4 +41,6 @@ public:
inline void SetIllumination(float illum) { m_illum = illum; }
};
}
#endif // MATERIAL_H_

View File

@ -7,6 +7,8 @@
#include "engine/renderer/basics.h"
namespace Engine {
class Mesh {
public: // TODO: abstract away
unsigned int m_vao, m_vbo, m_ebo;
@ -24,4 +26,6 @@ public:
void Render(unsigned int count);
};
}
#endif // MESH_H_

View File

@ -8,6 +8,8 @@
#include "engine/export.h"
#include "engine/components/light.h"
namespace Engine {
// TODO: make static or singleton
class ENGINE_API Renderer {
public:
@ -37,4 +39,6 @@ private:
glm::mat4 m_view;
};
}
#endif // RENDERER_H_

View File

@ -7,6 +7,8 @@
#include "engine/export.h"
namespace Engine {
class ENGINE_API Shader
{
public:
@ -45,4 +47,6 @@ private:
void checkLinkingError();
};
}
#endif // SHADER_H

View File

@ -3,6 +3,8 @@
#include <string>
#include <memory>
namespace Engine {
class Texture {
public:
Texture() : m_id(0) {}
@ -13,4 +15,6 @@ private:
unsigned int m_id;
};
}
#endif // TEXTURE_H_

View File

@ -14,6 +14,8 @@
#include "engine/export.h"
namespace Engine {
enum ObjElement { OHASH, MTLLIB, USEMTL, O, V, VN, VT, F, OUNKNOWN };
enum MtlElement { MHASH, NEWMTL, NS, KA, KS, KD, NI, D, ILLUM, MAP_KD, MAP_KA, MUNKNOWN };
@ -53,4 +55,6 @@ private:
std::unordered_map<std::string, std::shared_ptr<Material>> m_materials;
};
}
#endif // MODEL_H_