74 void onUpdate(std::function<
void()> callback,
bool overwrite =
false);
86 void onUpdate(std::function<
void(
const std::optional<sf::Event>&)> callback,
bool overwrite =
false);
106 void onWindowResized(std::function<
void(
const std::optional<sf::Event>&)> callback,
bool overwrite =
false);
124 void onWindowFocusGained(std::function<
void(
const std::optional<sf::Event>&)> callback,
bool overwrite =
false);
142 void onWindowFocusLost(std::function<
void(
const std::optional<sf::Event>&)> callback,
bool overwrite =
false);
149 bool filter(
const std::optional<sf::Event>& event,
Core* component)
override {
return true; }
150 void fire()
override;
151 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 onWindowFocusLost(std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=false)
Register a callback invoked when the application window loses OS focus, receiving the raw SFML event.
void onUpdate(std::function< void()> callback, bool overwrite=false)
Register a no-argument callback invoked every frame.
void onWindowResized(std::function< void()> callback, bool overwrite=false)
Register a no-argument callback invoked when the application window is resized.
void onWindowFocusGained(std::function< void()> callback, bool overwrite=false)
Register a no-argument callback invoked when the application window gains OS focus.
void onWindowFocusLost(std::function< void()> callback, bool overwrite=false)
Register a no-argument callback invoked when the application window loses OS focus.
void onWindowResized(std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=false)
Register a callback invoked when the application window is resized, receiving the raw SFML event.
void onUpdate(std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=false)
Register a callback invoked every frame, receiving the SFML event.
void onWindowFocusGained(std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=false)
Register a callback invoked when the application window gains OS focus, receiving the raw SFML event.