Wiki Page Content

Differences between revisions 1 and 2
Revision 1 as of 2010-03-24 19:49:35
Size: 1749
Editor: SheenaSmith
Comment: create page, add content (Rev 5540)
Revision 2 as of 2010-03-24 20:06:38
Size: 1761
Editor: SheenaSmith
Comment: minor correction
Deletions are marked like this. Additions are marked like this.
Line 40: Line 40:
If '''action''' is SDL_PEEKEVENT, up to '''numevents''' events at the front of the event queue, matching mask, will be returned and will not be removed from the queue. If '''action''' is SDL_PEEKEVENT, up to '''numevents''' events at the front of the event queue, matching '''mask''', will be returned and will not be removed from the queue.
Line 42: Line 42:
If '''action''' is SDL_GETEVENT, up to '''numevents''' events at the front of the event queue, matching mask, will be returned and will be removed from the queue. If '''action''' is SDL_GETEVENT, up to '''numevents''' events at the front of the event queue, matching '''mask''', will be returned and will be removed from the queue.

DRAFT

SDL_PeepEvents

Use this function to check the event queue for messages and optionally returns them.

Syntax

int SDL_PeepEvents(SDL_Event*      events,
                   int             numevents,
                   SDL_eventaction action,
                   Uint32          mask)

Function Parameters

events

a pointer to the ID of the event queue to query

numevents

the number of events to work with; see Remarks for details

action

how to handle the events in the queue; see Remarks for details

mask

criteria by which to select events from the queue

Return Value

Returns the number of events actually stored, or -1 if there was an error; call SDL_GetError() for more information.

Code Examples

You can add your code example here

Remarks

action may be any of the following (from enum SDL_eventaction):

SDL_ADDEVENT

SDL_PEEKEVENT

SDL_GETEVENT

If action is SDL_ADDEVENT, up to numevents events will be added to the back of the event queue.

If action is SDL_PEEKEVENT, up to numevents events at the front of the event queue, matching mask, will be returned and will not be removed from the queue.

If action is SDL_GETEVENT, up to numevents events at the front of the event queue, matching mask, will be returned and will be removed from the queue.

This function is thread-safe.


CategoryAPI, CategoryEvents

None: SDL_PeepEvents (last edited 2015-04-26 19:50:04 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit