OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SdlEventLoop Class Reference

#include <SdlEventLoop.h>

Inheritance diagram for SdlEventLoop:
PlatformEventLoop

Public Member Functions

 SdlEventLoop (SdlPlatformSharedState *state)
 
virtual ~SdlEventLoop ()
 
virtual void exec (PlatformEventHandler *eventHandler) override
 
virtual void quit () override
 
virtual void processMessages (PlatformEventHandler *eventHandler, int count=-1) override
 
virtual void waitForMessages () override
 
- Public Member Functions inherited from PlatformEventLoop
virtual ~PlatformEventLoop ()=default
 
virtual void exec (PlatformEventHandler *eventHandler)=0
 
virtual void quit ()=0
 
virtual void processMessages (PlatformEventHandler *eventHandler, int count=-1)=0
 
virtual void waitForMessages ()=0
 

Private Member Functions

void dispatchEvent (PlatformEventHandler *eventHandler, const SDL_Event *event)
 
void dispatchEvent (PlatformEventHandler *eventHandler, const PlatformEvent *event)
 
void dispatchNativeEvent (PlatformEventHandler *eventHandler, const SDL_Event *event)
 
void dispatchQuitEvent (PlatformEventHandler *eventHandler, const SDL_QuitEvent *event)
 
void dispatchKeyEvent (PlatformEventHandler *eventHandler, const SDL_KeyboardEvent *event)
 
void dispatchMouseMoveEvent (PlatformEventHandler *eventHandler, const SDL_MouseMotionEvent *event)
 
void dispatchMouseButtonEvent (PlatformEventHandler *eventHandler, const SDL_MouseButtonEvent *event)
 
void dispatchMouseWheelEvent (PlatformEventHandler *eventHandler, const SDL_MouseWheelEvent *event)
 
void dispatchTouchFingerEvent (PlatformEventHandler *eventHandler, const SDL_TouchFingerEvent *event)
 
void dispatchWindowEvent (PlatformEventHandler *eventHandler, const SDL_WindowEvent *event)
 
void dispatchWindowMoveEvent (PlatformEventHandler *eventHandler, const SDL_WindowEvent *event)
 
void dispatchWindowResizeEvent (PlatformEventHandler *eventHandler, const SDL_WindowEvent *event)
 
void dispatchGamepadConnectedEvent (PlatformEventHandler *eventHandler, const SDL_ControllerDeviceEvent *event)
 
void dispatchGamepadDisconnectedEvent (PlatformEventHandler *eventHandler, const SDL_ControllerDeviceEvent *event)
 
void dispatchGamepadButtonEvent (PlatformEventHandler *eventHandler, const SDL_ControllerButtonEvent *event)
 
void dispatchGamepadAxisEvent (PlatformEventHandler *eventHandler, const SDL_ControllerAxisEvent *event)
 
void dispatchTextInputEvent (PlatformEventHandler *eventHandler, const SDL_TextInputEvent *event)
 

Private Attributes

SdlPlatformSharedState_state = nullptr
 
bool _quitRequested = false
 

Constructor & Destructor Documentation

◆ SdlEventLoop()

SdlEventLoop::SdlEventLoop ( SdlPlatformSharedState state)
explicit

◆ ~SdlEventLoop()

SdlEventLoop::~SdlEventLoop ( )
virtual

Member Function Documentation

◆ dispatchEvent() [1/2]

void SdlEventLoop::dispatchEvent ( PlatformEventHandler eventHandler,
const PlatformEvent event 
)
private

◆ dispatchEvent() [2/2]

void SdlEventLoop::dispatchEvent ( PlatformEventHandler eventHandler,
const SDL_Event *  event 
)
private

◆ dispatchGamepadAxisEvent()

void SdlEventLoop::dispatchGamepadAxisEvent ( PlatformEventHandler eventHandler,
const SDL_ControllerAxisEvent *  event 
)
private

◆ dispatchGamepadButtonEvent()

void SdlEventLoop::dispatchGamepadButtonEvent ( PlatformEventHandler eventHandler,
const SDL_ControllerButtonEvent *  event 
)
private

◆ dispatchGamepadConnectedEvent()

void SdlEventLoop::dispatchGamepadConnectedEvent ( PlatformEventHandler eventHandler,
const SDL_ControllerDeviceEvent *  event 
)
private

◆ dispatchGamepadDisconnectedEvent()

void SdlEventLoop::dispatchGamepadDisconnectedEvent ( PlatformEventHandler eventHandler,
const SDL_ControllerDeviceEvent *  event 
)
private

◆ dispatchKeyEvent()

void SdlEventLoop::dispatchKeyEvent ( PlatformEventHandler eventHandler,
const SDL_KeyboardEvent *  event 
)
private

◆ dispatchMouseButtonEvent()

void SdlEventLoop::dispatchMouseButtonEvent ( PlatformEventHandler eventHandler,
const SDL_MouseButtonEvent *  event 
)
private

◆ dispatchMouseMoveEvent()

void SdlEventLoop::dispatchMouseMoveEvent ( PlatformEventHandler eventHandler,
const SDL_MouseMotionEvent *  event 
)
private

◆ dispatchMouseWheelEvent()

void SdlEventLoop::dispatchMouseWheelEvent ( PlatformEventHandler eventHandler,
const SDL_MouseWheelEvent *  event 
)
private

◆ dispatchNativeEvent()

void SdlEventLoop::dispatchNativeEvent ( PlatformEventHandler eventHandler,
const SDL_Event *  event 
)
private

◆ dispatchQuitEvent()

void SdlEventLoop::dispatchQuitEvent ( PlatformEventHandler eventHandler,
const SDL_QuitEvent *  event 
)
private

◆ dispatchTextInputEvent()

void SdlEventLoop::dispatchTextInputEvent ( PlatformEventHandler eventHandler,
const SDL_TextInputEvent *  event 
)
private

◆ dispatchTouchFingerEvent()

void SdlEventLoop::dispatchTouchFingerEvent ( PlatformEventHandler eventHandler,
const SDL_TouchFingerEvent *  event 
)
private

◆ dispatchWindowEvent()

void SdlEventLoop::dispatchWindowEvent ( PlatformEventHandler eventHandler,
const SDL_WindowEvent *  event 
)
private

◆ dispatchWindowMoveEvent()

void SdlEventLoop::dispatchWindowMoveEvent ( PlatformEventHandler eventHandler,
const SDL_WindowEvent *  event 
)
private

◆ dispatchWindowResizeEvent()

void SdlEventLoop::dispatchWindowResizeEvent ( PlatformEventHandler eventHandler,
const SDL_WindowEvent *  event 
)
private

◆ exec()

void SdlEventLoop::exec ( PlatformEventHandler eventHandler)
overridevirtual

Starts this event loop.

This function blocks until either quit is called from inside the event handler code, or an application is closed by the user (e.g. after the last window is closed, or Command+Q is pressed on Mac).

Parameters
eventHandlerCallback for event processing.

Implements PlatformEventLoop.

◆ processMessages()

void SdlEventLoop::processMessages ( PlatformEventHandler eventHandler,
int  count = -1 
)
overridevirtual

Processes the messages that are currently in the message queue, and returns. Returns immediately if there are no messages in the message queue.

Parameters
eventHandlerCallback for event processing.
countMaximum number of messages to process, -1 means unlimited.

Implements PlatformEventLoop.

◆ quit()

void SdlEventLoop::quit ( )
overridevirtual

Tells this event loop to exit. Does nothing if the event loop is not running.

Implements PlatformEventLoop.

◆ waitForMessages()

void SdlEventLoop::waitForMessages ( )
overridevirtual

Blocks until at least one message is delivered to the queue, and returns.

Implements PlatformEventLoop.

Member Data Documentation

◆ _quitRequested

bool SdlEventLoop::_quitRequested = false
private

◆ _state

SdlPlatformSharedState* SdlEventLoop::_state = nullptr
private

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