|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
Awaitable stream of GLFW window input events. More...
#include <WindowEventSource.hpp>
Inheritance diagram for MayaFlux::Vruta::WindowEventSource:
Collaboration diagram for MayaFlux::Vruta::WindowEventSource:Public Member Functions | |
| Kriya::WindowEventAwaiter | await_event (Core::WindowEventType type) |
| Creates an awaiter that resumes on the next event matching a type. | |
| void | clear () override |
| Discards all buffered signals. | |
| std::pair< double, double > | get_mouse_position () const |
| Returns the last known cursor position in screen coordinates. | |
| bool | has_pending () const override |
| Returns true if any signals are buffered and not yet consumed. | |
| bool | is_key_pressed (IO::Keys key) const |
| Returns true if the given key is currently held. | |
| bool | is_mouse_pressed (int button) const |
| Returns true if the given mouse button is currently held. | |
| Kriya::WindowEventAwaiter | next_event () |
| Creates an awaiter that resumes on the next event of any type. | |
| WindowEventSource & | operator= (const WindowEventSource &)=delete |
| WindowEventSource & | operator= (WindowEventSource &&) noexcept=default |
| size_t | pending_count () const |
| void | signal (Core::WindowEvent event) |
| Enqueue a window event and resume matching waiters. | |
| WindowEventSource ()=default | |
| WindowEventSource (const WindowEventSource &)=delete | |
| WindowEventSource (WindowEventSource &&) noexcept=default | |
| ~WindowEventSource () override=default | |
Public Member Functions inherited from MayaFlux::Vruta::EventSource | |
| EventSource ()=default | |
| EventSource (const EventSource &)=delete | |
| EventSource (EventSource &&) noexcept=default | |
| EventSource & | operator= (const EventSource &)=delete |
| EventSource & | operator= (EventSource &&) noexcept=default |
| virtual | ~EventSource ()=default |
Private Member Functions | |
| std::optional< Core::WindowEvent > | pop_event (const WindowEventFilter &filter) |
| Removes and returns the first pending event matching the filter. | |
Private Attributes | |
| std::unordered_map< int, bool > | m_button_states |
| std::unordered_map< int16_t, bool > | m_key_states |
| double | m_mouse_x {} |
| double | m_mouse_y {} |
| std::queue< Core::WindowEvent > | m_pending_events |
Friends | |
| class | Kriya::WindowEventAwaiter |
Additional Inherited Members | |
Protected Member Functions inherited from MayaFlux::Vruta::EventSource | |
| void | dispatch (const void *event) |
| Iterates the waiter list, passing the type-erased signal to each. | |
| void | register_waiter (Kriya::EventAwaiter *awaiter) |
| void | unregister_waiter (Kriya::EventAwaiter *awaiter) |
Awaitable stream of GLFW window input events.
Signals are produced by GLFW callbacks on the main thread. Coroutines suspend via WindowEventAwaiter and are resumed synchronously from signal(). Tracks input state for immediate polling via is_key_pressed(), is_mouse_pressed(), and get_mouse_position().
Definition at line 69 of file WindowEventSource.hpp.