home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !SDL / man / SDL_PollEvent.3 < prev    next >
Encoding:
Text File  |  2006-09-20  |  1.9 KB  |  70 lines

  1. <!-- manual page source format generated by PolyglotMan v3.0.8+X.Org, -->
  2. <!-- available at http://polyglotman.sourceforge.net/ -->
  3.  
  4. <html>
  5. <head>
  6. <title>"SDL_PollEvent"("3") manual page</title>
  7. </head>
  8. <body bgcolor='#efefef' text='black' link='blue' vlink='#551A8B' alink='red'>
  9. <a href='#toc'>Table of Contents</a><p>
  10.  
  11. <h2><a name='sect0' href='#toc0'>Name</a></h2>
  12. SDL_PollEvent- Polls for currently pending events. 
  13. <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
  14. <p>
  15. <b>#include "SDL.h"
  16. <p>
  17. </b><b>int <b>SDL_PollEvent</b></b>(<b>SDL_Event *event</b>); 
  18. <h2><a name='sect2' href='#toc2'>Description</a></h2>
  19. <p>
  20. Polls for currently pending
  21. events, and returns <b>1</b> if there are any pending events, or <b>0</b> if there are
  22. none available.  <p>
  23. If <b>event</b> is not <b>NULL</b>, the next event is removed from the
  24. queue and stored in that area. 
  25. <h2><a name='sect3' href='#toc3'>Examples</a></h2>
  26. <p>
  27. <p>
  28. <br>
  29. <pre>CWSDL_Event event; /* Event structure */
  30. .
  31. .
  32. .
  33. /* Check for events */
  34. while(SDL_PollEvent(&event)){  /* Loop until there are no events left on
  35. the queue */
  36.   switch(event.type){  /* Process the appropiate event type */
  37.     case SDL_KEYDOWN:  /* Handle a KEYDOWN event */         
  38.       printf("Oh! Key press
  39. ");
  40.       break;
  41.     case SDL_MOUSEMOTION:
  42.       .
  43.       .
  44.       .
  45.     default: /* Report an unhandled event */
  46.       printf("I don't know what this event is!
  47. ");
  48.   }
  49. }
  50. </pre><p>
  51.  
  52. <h2><a name='sect4' href='#toc4'>See Also</a></h2>
  53. <p>
  54. <i><b>SDL_Event</b></i>, <i><b>SDL_WaitEvent</b></i>, <i><b>SDL_PeepEvents</b></i> 
  55. <!--
  56.   
  57.  <p>
  58.  
  59. <hr><p>
  60. <a name='toc'><b>Table of Contents</b></a><p>
  61. <ul>
  62. <li><a name='toc0' href='#sect0'>Name</a></li>
  63. <li><a name='toc1' href='#sect1'>Synopsis</a></li>
  64. <li><a name='toc2' href='#sect2'>Description</a></li>
  65. <li><a name='toc3' href='#sect3'>Examples</a></li>
  66. <li><a name='toc4' href='#sect4'>See Also</a></li>
  67. </ul>
  68. </body>
  69. </html>
  70.