light/modules/app/public/application.hpp
light7734 638a009047
Some checks reported errors
continuous-integration/drone/push Build was killed
refactor: surface, app, tests, ecs refactors
2025-07-28 20:45:24 +03:30

44 lines
920 B
C++

#pragma once
namespace lt::app {
class ISystem;
extern Scope<class Application> create_application();
/** The main application class.
* Think of this like an aggregate of systems, you register systems through this interface.
* Then they'll tick every "application frame".
*/
class Application
{
public:
Application(const Application &) = delete;
Application(Application &&) = delete;
auto operator=(const Application &) -> Application & = delete;
auto operator=(Application &&) -> Application & = delete;
virtual ~Application() = default;
void game_loop();
void register_system(Ref<app::ISystem> system);
void unregister_system(Ref<app::ISystem> system);
protected:
Application() = default;
private:
std::vector<Ref<app::ISystem>> m_systems;
std::vector<Ref<app::ISystem>> m_systems_to_be_unregistered;
std::vector<Ref<app::ISystem>> m_systems_to_be_registered;
};
} // namespace lt::app