diff --git a/engine/ICEngine.hpp b/engine/ICEngine.hpp index 041f5a9..247f3a6 100644 --- a/engine/ICEngine.hpp +++ b/engine/ICEngine.hpp @@ -6,5 +6,6 @@ #define ICENGINE_HPP #include "src/core/Logger.hpp" +#include "src/core/ICEApplication.hpp" #endif //ICENGINE_HPP diff --git a/engine/src/core/ICEApplication.cpp b/engine/src/core/ICEApplication.cpp new file mode 100644 index 0000000..ad7f6ee --- /dev/null +++ b/engine/src/core/ICEApplication.cpp @@ -0,0 +1,24 @@ +// +// Created by illyum on 9/15/2024. +// + +#include "ICEngine.hpp" +#include "pch.hpp" + +namespace ICEngine { + void StartApplication() { + Log::Init(); + CORE_LOG_TRACE("Starting ICEngine"); + + ICEApplication* app = CreateICEApplication(); + if (app) { + CORE_LOG_TRACE("Starting User Application"); + app->Run(); + delete app; + } else { + CORE_LOG_FATAL("Could not start User Application"); + } + + CORE_LOG_TRACE("Shutting down ICEngine"); + } +} \ No newline at end of file diff --git a/engine/src/core/ICEApplication.hpp b/engine/src/core/ICEApplication.hpp new file mode 100644 index 0000000..a72cce5 --- /dev/null +++ b/engine/src/core/ICEApplication.hpp @@ -0,0 +1,19 @@ +// +// Created by illyum on 9/15/2024. +// + +#pragma once + +namespace ICEngine { + class ICEApplication { + public: + ICEApplication() {} + virtual ~ICEApplication() {} + virtual void Run() = 0; + }; + + void StartApplication(); // Starts the application, managed by the engine. + + // Application-specific function that will be defined by the user + extern ICEApplication* CreateICEApplication(); +} \ No newline at end of file