8#ifndef MALENA_APPMANAGER_H
9#define MALENA_APPMANAGER_H
16#include <SFML/Graphics.hpp>
77 inline static bool _isDrawing =
false;
79 inline static std::vector<std::function<void()>> _deferredUnloads;
96 const std::string& title,
115 static bool isDrawing() {
return _isDrawing; }
116 static void deferUnload(std::function<
void()> op)
118 _deferredUnloads.push_back(std::move(op));
129 static AppManager& get() {
return *_instance; }
133 void fireInputEvents(
const std::optional<sf::Event>& event);
134 void fireUpdateEvents();
void run()
Enter the main loop and run until the window is closed.
virtual ~AppManager()=default
AppManager(const sf::VideoMode &videoMode, const std::string &title, sf::RenderWindow &window=WindowManager::getWindow())
Construct an AppManager and create the SFML window.
Static, type-safe collection manager for Core-derived objects.
Trait that adds one-time initialization lifecycle hooks to any class.
sf::RenderWindow & getWindow()
Return the framework's shared sf::RenderWindow.