GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


Manpage of SDL_PollEvent

SDL_PollEvent

Index
 

NAME

SDL_PollEvent- Polls for currently pending events&.  

SYNOPSIS

fB#include "SDL&.h"

fBint fBSDL_PollEventfPfR(fBSDL_Event *eventfR);  

DESCRIPTION

Polls for currently pending events, and returns fB1fR if there are any pending events, or fB0fR if there are none available&.

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

EXAMPLES

f(CWSDL_Event event; /* Event structure */

&.
&.
&.
/* Check for events */
while(SDL_PollEvent(&event)){  /* Loop until there are no events left on the queue */
  switch(event&.type){  /* Process the appropiate event type */
    case SDL_KEYDOWN:  /* Handle a KEYDOWN event */         
      printf("Oh! Key press
");
      break;
    case SDL_MOUSEMOTION:
      &.
      &.
      &.
    default: /* Report an unhandled event */
      printf("I don&'t know what this event is!
");
  }
}fR

 

SEE ALSO

fIfBSDL_EventfRfR, fIfBSDL_WaitEventfPfR, fIfBSDL_PeepEventsfPfR


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
SEE ALSO