Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

PG_SDLEventSupplier Class Reference

Classes which passes SDL_Events directly from SDL to Paragui. More...

#include <pgsdleventsupplier.h>

Inheritance diagram for PG_SDLEventSupplier:

Inheritance graph
[legend]
List of all members.

Public Member Functions

bool PollEvent (SDL_Event *event)
 Polls for currently pending events, and returns true if there are any pending events, or false if there are none available.
bool PeepEvent (SDL_Event *event)
 Checks if an event is in the queue.
int WaitEvent (SDL_Event *event)
 Waits indefinitely for the next available event.
int GetMouseState (int &x, int &y)
 Get the current mouse position.

Protected Member Functions

void CombineMouseMotionEvents (SDL_Event *event)
 Mouse motion events can fill the event queue and should also be processed without much delay.

Detailed Description

Classes which passes SDL_Events directly from SDL to Paragui.

Author:
Martin Bickel
No preprocessing or filtering takes place.

Definition at line 47 of file pgsdleventsupplier.h.


Member Function Documentation

void PG_SDLEventSupplier::CombineMouseMotionEvents SDL_Event *  event  )  [protected]
 

Mouse motion events can fill the event queue and should also be processed without much delay.

This function is passed a newly received Event. It checks if it is a mouse motion event and, if this is the case, checks the event queue for more mouse motion events, which are then incorporated into the current event and removed from the queue.

Parameters:
event pointer to an event structure with a freshly received event

Definition at line 33 of file pgsdleventsupplier.cpp.

References PeepEvent(), and WaitEvent().

Referenced by PollEvent(), EventSupplier::PollEvent(), WaitEvent(), and EventSupplier::WaitEvent().

int PG_SDLEventSupplier::GetMouseState int &  x,
int &  y
[virtual]
 

Get the current mouse position.

Parameters:
x current mouse x position
y current mouse y position
Returns:
bitmap of pressed mouse buttons

Implements PG_EventSupplier.

Definition at line 70 of file pgsdleventsupplier.cpp.

bool PG_SDLEventSupplier::PeepEvent SDL_Event *  event  )  [virtual]
 

Checks if an event is in the queue.

If there is, it will be copied into the event structure, WITHOUT being removed from the event queue.

Parameters:
event pointer to an event structure
Returns:
true - events are available

Implements PG_EventSupplier.

Reimplemented in EventSupplier.

Definition at line 51 of file pgsdleventsupplier.cpp.

Referenced by CombineMouseMotionEvents().

bool PG_SDLEventSupplier::PollEvent SDL_Event *  event  )  [virtual]
 

Polls for currently pending events, and returns true if there are any pending events, or false if there are none available.

If event is not NULL, the next event is removed from the queue and stored in that area.

Parameters:
event pointer to an event structure
Returns:
true - events are available

Implements PG_EventSupplier.

Reimplemented in EventSupplier.

Definition at line 56 of file pgsdleventsupplier.cpp.

References CombineMouseMotionEvents().

int PG_SDLEventSupplier::WaitEvent SDL_Event *  event  )  [virtual]
 

Waits indefinitely for the next available event.

Parameters:
event pointer to an event structure
Returns:
return 0 if there was an error while waiting for events

Implements PG_EventSupplier.

Reimplemented in EventSupplier.

Definition at line 64 of file pgsdleventsupplier.cpp.

References CombineMouseMotionEvents().

Referenced by CombineMouseMotionEvents().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:19:27 2008 for Advanced Strategic Command by  doxygen 1.4.2