GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SDL_PollEvent(3) SDL API Reference SDL_PollEvent(3)

SDL_PollEvent - Polls for currently pending events.

#include "SDL.h"

int SDL_PollEvent(SDL_Event *event);

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

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

SDL_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!
");
  }
}

SDL_Event, SDL_WaitEvent, SDL_PeepEvents
Tue 11 Sep 2001, 22:59 SDL

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.