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

◆ window_resized()

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

Creates an Event coroutine that triggers on window resize.

Delivers the new logical window size (Core::WindowEventType::WINDOW_RESIZED), the same event the Vulkan backend uses to flag swapchain recreation. Not the framebuffer pixel size (Core::WindowEventType::FRAMEBUFFER_RESIZED).

Parameters
windowWindow to listen to.
callbackCalled with the new (width, height).
Returns
Event coroutine that can be added to EventManager.

Definition at line 244 of file InputEvents.cpp.

247{
248 auto& promise = co_await GetEventPromise {};
249 auto& source = window->get_event_source();
250
252 filter.event_type = Core::WindowEventType::WINDOW_RESIZED;
253
254 while (true) {
255 if (promise.should_terminate) {
256 break;
257 }
258
259 auto event = co_await WindowEventAwaiter(source, filter);
260
261 if (auto* resize_data = std::get_if<Core::WindowEvent::ResizeData>(&event.data)) {
262 callback(resize_data->width, resize_data->height);
263 }
264 }
265}
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_RESIZED.

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

+ Here is the caller graph for this function: