libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
promeki::SDLEventPump Class Reference

Pumps SDL events into the promeki event system. More...

#include <sdleventpump.h>

Public Member Functions

 SDLEventPump (const SDLEventPump &)=delete
 
SDLEventPumpoperator= (const SDLEventPump &)=delete
 
void pumpEvents ()
 Drains all pending SDL events and dispatches them.
 
void registerWindow (SDLWindow *window)
 Registers a window for event routing.
 
void unregisterWindow (SDLWindow *window)
 Unregisters a window from event routing.
 
SDLWindowfindWindow (uint32_t id) const
 Finds a registered window by SDL window ID.
 

Detailed Description

Pumps SDL events into the promeki event system.

Translates SDL events into promeki KeyEvent, MouseEvent, and window lifecycle calls on the appropriate SDLWindow. Windows register themselves with the pump so that events can be routed by SDL window ID.

This is not an ObjectBase — it is infrastructure owned by SdlSubsystem (similar to TuiScreen or TuiInputParser).

Thread Safety
Thread-affine. Must only be used on the SDL event thread (the thread that owns the bound SdlSubsystem).

Member Function Documentation

◆ findWindow()

SDLWindow * promeki::SDLEventPump::findWindow ( uint32_t  id) const

Finds a registered window by SDL window ID.

Parameters
idThe SDL window ID.
Returns
The SDLWindow, or nullptr if not found.

◆ pumpEvents()

void promeki::SDLEventPump::pumpEvents ( )

Drains all pending SDL events and dispatches them.

Non-blocking: calls SDL_PollEvent in a loop until the SDL queue is empty. SdlSubsystem invokes this from the EventLoop IoSource callback that fires when SDL_AddEventWatch signals that new events have arrived.

◆ registerWindow()

void promeki::SDLEventPump::registerWindow ( SDLWindow window)

Registers a window for event routing.

Parameters
windowThe SDLWindow to register.

◆ unregisterWindow()

void promeki::SDLEventPump::unregisterWindow ( SDLWindow window)

Unregisters a window from event routing.

Parameters
windowThe SDLWindow to unregister.

The documentation for this class was generated from the following file: