feat: refactoring
This commit is contained in:
@ -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
|
||||
@ -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_
|
||||
@ -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_
|
||||
@ -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_
|
||||
@ -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_
|
||||
@ -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_
|
||||
@ -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
|
||||
@ -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_
|
||||
|
||||
@ -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_
|
||||
Reference in New Issue
Block a user