Wiki Page Content

Differences between revisions 5 and 6
Revision 5 as of 2010-10-18 04:38:27
Size: 1472
Editor: SheenaSmith
Comment: update content - SDL_EventFilter
Revision 6 as of 2011-11-07 01:11:52
Size: 1355
Editor: SheenaSmith
Comment: update content for consistency - callback (table); camelcase
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
#pragma disable-camelcase #pragma camelcase off
Line 8: Line 8:
<<Color2(green,I suspect that the perspective in the header where this was taken from was different and it should read:)>>

Use this function to filter the current event queue, removing any events for which the filter returns 0.
<<Color2(green,Is this more appropriate wording for this context?)>> <<BR>>
Use this function to filter the current event queue and remove filtered events.
Line 21: Line 20:
||'''filter'''||a function that gets called when an event happens; see [[#Remarks|Remarks]] for details||
||'''userdata'''||^a pointer filled in with user-specified information to be filtered^||
||'''filter'''||the function to call when an event happens; see [[#Remarks|Remarks]] for details||
||'''userdata'''||a pointer that is passed to '''filter'''||
Line 30: Line 29:
The '''filter''' function has the following form:
{{{
int SDL_EventFilter(void* userdata, SDL_Event* event)
The function prototype for '''filter''' is:
 {{{
int SDL_EventFilter(void*      userdata,                      SDL_Event* event)
Line 34: Line 34:
where '''userdata''' is the event queue to filter and '''event''' is the desired event to pull from the queue.
<<Color2(green,Should this be formatted like the syntax section?)>>
 . where its parameters are:
 ||`userdata`||what was passed as '''userdata''' to [[SDL_FilterEvents]]()||
 ||`event`||the desired event to pull from the queue||
Line 40: Line 41:
 .[[SDL_GetEventFilter]] ???
 .[[SDL_SetEventFilter]] ???
 .[[SDL_GetEventFilter]]
 .[[SDL_SetEventFilter]]

DRAFT

SDL_FilterEvents

Use this function to run the filter function on the current event queue, removing any events for which the filter returns 0.

green


Use this function to filter the current event queue and remove filtered events.

Syntax

void SDL_FilterEvents(SDL_EventFilter filter,
                      void*           userdata)

Function Parameters

filter

the function to call when an event happens; see Remarks for details

userdata

a pointer that is passed to filter

Code Examples

You can add your code example here

Remarks

The function prototype for filter is:

  • int SDL_EventFilter(void*      userdata, 
                        SDL_Event* event)
  • where its parameters are:

    userdata

    what was passed as userdata to SDL_FilterEvents()

    event

    the desired event to pull from the queue

See SDL_SetEventFilter() for more information.


CategoryAPI, CategoryEvents

None: SDL_FilterEvents (last edited 2015-12-19 22:23:21 by PhilippWiesemann)

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