feat: move entrypoint to the engine
This commit is contained in:
@ -1,6 +1,8 @@
|
|||||||
#ifndef APPLICATION_H_
|
#ifndef APPLICATION_H_
|
||||||
#define APPLICATION_H_
|
#define APPLICATION_H_
|
||||||
|
|
||||||
|
#include "engine/window/events/window.h"
|
||||||
|
|
||||||
class IApplication {
|
class IApplication {
|
||||||
public:
|
public:
|
||||||
virtual ~IApplication() = default;
|
virtual ~IApplication() = default;
|
||||||
|
19
engine/include/engine/engine.h
Normal file
19
engine/include/engine/engine.h
Normal 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;
|
||||||
|
}
|
@ -1,23 +1,12 @@
|
|||||||
#ifndef WIN32
|
|
||||||
#define GLEW_STATIC
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#include <corecrt_math_defines.h>
|
|
||||||
#endif
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <glm/ext/matrix_clip_space.hpp>
|
#include <glm/gtc/constants.hpp>
|
||||||
#include <glm/ext/matrix_transform.hpp>
|
|
||||||
|
|
||||||
#include "engine/renderer/shader.h"
|
|
||||||
#include "engine/renderer/wavefront.h"
|
#include "engine/renderer/wavefront.h"
|
||||||
#include "engine/renderer/core.h"
|
|
||||||
#include "engine/renderer/renderer.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/transform.h"
|
||||||
#include "engine/components/light.h"
|
#include "engine/components/light.h"
|
||||||
@ -26,6 +15,8 @@
|
|||||||
#include "engine/components/rotate.h"
|
#include "engine/components/rotate.h"
|
||||||
#include "engine/components/batch.h"
|
#include "engine/components/batch.h"
|
||||||
|
|
||||||
|
#include "engine/engine.h"
|
||||||
|
|
||||||
class Game : public IApplication {
|
class Game : public IApplication {
|
||||||
public:
|
public:
|
||||||
Game() : m_renderer(m_registry) {
|
Game() : m_renderer(m_registry) {
|
||||||
@ -232,7 +223,6 @@ private:
|
|||||||
Uint64 m_currentTicks;
|
Uint64 m_currentTicks;
|
||||||
};
|
};
|
||||||
|
|
||||||
int main() {
|
IApplication* CreateApplication() {
|
||||||
Engine::Run(std::make_unique<Game>());
|
return new Game();
|
||||||
return 0;
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user