feat: move entrypoint to the engine

This commit is contained in:
2025-10-16 19:56:17 +02:00
parent bd7f52ae3d
commit 800d0eb8e4
3 changed files with 28 additions and 17 deletions

View File

@ -1,6 +1,8 @@
#ifndef APPLICATION_H_
#define APPLICATION_H_
#include "engine/window/events/window.h"
class IApplication {
public:
virtual ~IApplication() = default;

View File

@ -0,0 +1,19 @@
#ifndef WIN32
#define GLEW_STATIC
#endif
#include <memory>
#ifdef WIN32
#include <corecrt_math_defines.h>
#endif
#include "engine/app/app.h"
#include "engine/renderer/core.h"
extern IApplication* CreateApplication();
int main() {
Engine::Run(std::unique_ptr<IApplication>(CreateApplication()));
return 0;
}

View File

@ -1,23 +1,12 @@
#ifndef WIN32
#define GLEW_STATIC
#endif
#include <iostream>
#include <memory>
#ifdef WIN32
#include <corecrt_math_defines.h>
#endif
#include <glm/glm.hpp>
#include <glm/ext/matrix_clip_space.hpp>
#include <glm/ext/matrix_transform.hpp>
#include <glm/gtc/constants.hpp>
#include "engine/renderer/shader.h"
#include "engine/renderer/wavefront.h"
#include "engine/renderer/core.h"
#include "engine/renderer/renderer.h"
#include "engine/IO/file_manager.h"
#include "engine/app/app.h"
#include "engine/components/transform.h"
#include "engine/components/light.h"
@ -26,6 +15,8 @@
#include "engine/components/rotate.h"
#include "engine/components/batch.h"
#include "engine/engine.h"
class Game : public IApplication {
public:
Game() : m_renderer(m_registry) {
@ -232,7 +223,6 @@ private:
Uint64 m_currentTicks;
};
int main() {
Engine::Run(std::make_unique<Game>());
return 0;
IApplication* CreateApplication() {
return new Game();
}