80 void onUpdate(std::function<
void(
const std::optional<sf::Event>&)> callback);
98 void onWindowResized(std::function<
void(
const std::optional<sf::Event>&)> callback);
137 bool filter(
const std::optional<sf::Event>& event,
Core* component)
override {
return true; }
138 void fire()
override;
139 bool occurred()
override {
return true; }
#define ML_EXPORT(ClassName)
Register a Malena type with the framework.
Virtual base class for all Malena framework objects.
Base class for all event-receiving traits.
Base class for per-frame dispatchers in the Malena event system.
Trait that adds per-frame update and window lifecycle callbacks to any Core object.
void onUpdate(std::function< void(const std::optional< sf::Event > &)> callback)
Register a callback invoked every frame, receiving the SFML event.
void onWindowFocusGained(std::function< void(const std::optional< sf::Event > &)> callback)
Register a callback invoked when the application window gains OS focus, receiving the raw SFML event.
void onWindowFocusGained(std::function< void()> callback)
Register a no-argument callback invoked when the application window gains OS focus.
void onUpdate(std::function< void()> callback)
Register a no-argument callback invoked every frame.
void onWindowResized(std::function< void(const std::optional< sf::Event > &)> callback)
Register a callback invoked when the application window is resized, receiving the raw SFML event.
void onWindowFocusLost(std::function< void(const std::optional< sf::Event > &)> callback)
Register a callback invoked when the application window loses OS focus, receiving the raw SFML event.
void onWindowResized(std::function< void()> callback)
Register a no-argument callback invoked when the application window is resized.
void onWindowFocusLost(std::function< void()> callback)
Register a no-argument callback invoked when the application window loses OS focus.