diff --git a/Editor/src/app.cpp b/Editor/src/app.cpp index d4cdaf6..9910faf 100644 --- a/Editor/src/app.cpp +++ b/Editor/src/app.cpp @@ -1,3 +1,4 @@ +#include "../../YoggieEngine/src/EntryPoint.h" #include #include #include @@ -294,9 +295,9 @@ private: }; -int main (int argc , char* argv[]) { - - Editor().Run(); +YoggieEngine::Application* CreateApplication() { + + return new Editor(); } @@ -306,3 +307,6 @@ int main (int argc , char* argv[]) { + + + diff --git a/YoggieEngine/src/EntryPoint.h b/YoggieEngine/src/EntryPoint.h new file mode 100644 index 0000000..7a7c138 --- /dev/null +++ b/YoggieEngine/src/EntryPoint.h @@ -0,0 +1,22 @@ +#pragma once +#include "Application.h" + +extern YoggieEngine::Application* CreateApplication(); + +namespace YoggieEngine +{ + int entryPoint() + { + Application* app = CreateApplication(); + app->Run(); + + delete app; + return 0; + } +} + +int main(int argc, char** argv) { + + return YoggieEngine::entryPoint(); + +} \ No newline at end of file