Wiki Page Content

Differences between revisions 10 and 11
Revision 10 as of 2013-07-31 07:39:42
Size: 3054
Editor: ahmedtd
Comment: Documented numevents, minType, and maxType from a read of the code.
Revision 11 as of 2013-09-01 18:54:07
Size: 3087
Comment: Updated usage of Color2 macro.
Deletions are marked like this. Additions are marked like this.
Line 36: Line 36:
<<Anchor(action)>> '''action''' may be any of the following <<Color2(green,(from enum SDL_eventaction which has no page))>>: <<Anchor(action)>> '''action''' may be any of the following <<Color2(col=green,text="(from enum SDL_eventaction which has no page)")>>:
Line 42: Line 42:
<<Color2(green,The below is taken directly from the header. The info has been transferred to the table above as an optional way of being presented. Which should be kept?)>> <<Color2(col=green,text="The below is taken directly from the header. The info has been transferred to the table above as an optional way of being presented. Which should be kept?")>>
Line 54: Line 54:
<<Color2(green,Is the following true in 2.0?)>> You may have to call [[SDL_PumpEvents]]() before calling this function. Otherwise, the events may not be ready to be filtered when you call [[SDL_PeepEvents]]().<<BR>>* <<Color2(col=green,text="Is the following true in 2.0?")>> You may have to call [[SDL_PumpEvents]]() before calling this function. Otherwise, the events may not be ready to be filtered when you call [[SDL_PeepEvents]]().<<BR>>*

DRAFT

SDL_PeepEvents

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

Syntax

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

Function Parameters

events

Destination buffer for the retrieved events.

numevents

If action is SDL_ADDEVENT, the number of events to add back to the event queue. If action is SDL_PEEKEVENT or SDL_GETEVENT, the maximum number of events to retrieve.

action

Action to take; see Remarks for details

minType

Minimum value of the event type to be considered. SDL_FIRSTEVENT is a safe choice.

maxType

Maximum value of the event type to be considered. SDL_LASTEVENT is a safe choice.

Return Value

Returns the number of events actually stored or a negative error code on failure; call SDL_GetError() for more information.

Code Examples

Add a code example here.

Remarks

action may be any of the following (from enum SDL_eventaction which has no page)

:

SDL_ADDEVENT

up to numevents events will be added to the back of the event queue

SDL_PEEKEVENT

up to numevents events at the front of the event queue, within the specified minimum and maximum type, will be returned and will not be removed from the queue

SDL_GETEVENT

up to numevents events at the front of the event queue, within the specified minimum and maximum type, will be returned and will be removed from the queue

The below is taken directly from the header. The info has been transferred to the table above as an optional way of being presented. Which should be kept?

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, within the specified minimum and maximum type, 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, within the specified minimum and maximum type, will be returned and will be removed from the queue.

{i} This function is thread-safe.

*
Is the following true in 2.0?

You may have to call SDL_PumpEvents() before calling this function. Otherwise, the events may not be ready to be filtered when you call SDL_PeepEvents().
*


CategoryAPI, CategoryEvents

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

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