MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ on_scroll()

MAYAFLUX_API void MayaFlux::on_scroll ( const std::shared_ptr< Core::Window > &  window,
std::function< void(double, double)>  callback,
std::string  name = "" 
)

Schedule a mouse scroll handler.

Parameters
windowWindow to listen to
callbackFunction to call on scroll (xoffset, yoffset)
nameOptional name for the event handler

Example:

MayaFlux::on_scroll(window, [](double xoffset, double yoffset) {
// Handle mouse scroll with offsets
}, "mouse_scroll_handler");
void on_scroll(const std::shared_ptr< Core::Window > &window, std::function< void(double, double)> callback, std::string name)
Schedule a mouse scroll handler.
Definition Chronie.cpp:225

Definition at line 225 of file Chronie.cpp.

229{
230 auto event_manager = get_event_manager();
231 if (name.empty()) {
232 name = "scroll_" + std::to_string(event_manager->get_next_event_id());
233 }
234
235 auto event = std::make_shared<Vruta::Event>(
236 Kriya::mouse_scrolled(window, std::move(callback)));
237
238 event_manager->add_event(event, name);
239}
std::shared_ptr< Vruta::EventManager > get_event_manager()
Gets the event manager from the default engine.
Definition Chronie.cpp:27

References get_event_manager(), and MayaFlux::Kriya::mouse_scrolled().

Referenced by bind_viewport_preset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: