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

◆ window_closed()

MAYAFLUX_API Vruta::Event MayaFlux::Kriya::window_closed ( std::shared_ptr< Core::Window >  window,
std::function< void()>  callback 
)

Creates an Event coroutine that triggers on window close.

Parameters
windowWindow to listen to.
callbackCalled when the window is closed.
Returns
Event coroutine that can be added to EventManager.

Definition at line 267 of file InputEvents.cpp.

270{
271 auto& promise = co_await GetEventPromise {};
272 auto& source = window->get_event_source();
273
275 filter.event_type = Core::WindowEventType::WINDOW_CLOSED;
276
277 while (true) {
278 if (promise.should_terminate)
279 break;
280
281 co_await WindowEventAwaiter(source, filter);
282 callback();
283 }
284}
PickCallback callback
Definition Picker.cpp:22
std::weak_ptr< Core::Window > window
Definition Picker.cpp:23
Event-domain promise accessor with optional NetworkSource ownership transfer.
std::optional< Core::WindowEventType > event_type
Filter criteria for window input events.

References callback, MayaFlux::Vruta::WindowEventFilter::event_type, window, and MayaFlux::Core::WINDOW_CLOSED.

Referenced by MayaFlux::Portal::Forma::Context::register_handlers().

+ Here is the caller graph for this function: