Updated: October 28, 2024 |
Get the next available event
#include <mm/renderer/events.h>
const mmr_event_t* mmr_event_get(mmr_context_t *ctxt)
Get the next available event. The function returns an mmr_event_t structure, which contains detailed event information such as the new context state. Typically, you would call this function within an event-processing loop, after calling either mmr_event_arm() or mmr_event_wait().
This function is thread-safe only when using different context handles in each call. The event data returned by one mmr_event_get() call gets overwritten by the next call to this function with the same handle. This function is neither interrupt handler-safe nor signal-handler safe.
The data returned in the mmr_event_t structure is valid only until the next mmr_event_get() call. If you want to keep the data longer, copy the mmr_event_t contents into other program variables, cloning any strm_string_t fields within the structure.
A pointer to an event, or NULL on failure (check errno)