home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !SDL / man / SDL_ListModes.3 < prev    next >
Encoding:
Text File  |  2006-09-20  |  2.5 KB  |  84 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_ListModes"("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_ListModes- Returns a pointer to an array of available screen dimensions
  13. for the given format and video flags 
  14. <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
  15. <p>
  16. <b>#include "SDL.h" <p>
  17. </b><b>SDL_Rect **<b>SDL_ListModes</b></b>(<b>SDL_PixelFormat
  18. *format, Uint32 flags</b>); 
  19. <h2><a name='sect2' href='#toc2'>Description</a></h2>
  20. <p>
  21. Return a pointer to an array of available
  22. screen dimensions for the given format and video flags, sorted largest
  23. to smallest. Returns <b>NULL</b> if there are no dimensions available for a particular
  24. format, or <b>-1</b> if any dimension is okay for the given format. <p>
  25. If <b>format</b> is
  26. <b>NULL</b>, the mode list will be for the format returned by <i>SDL_GetVideoInfo()</i>-><b>vfmt</b>.
  27. The <b>flag</b> parameter is an OR'd combination of <i>surface</i> flags. The flags are
  28. the same as those used <i><b>SDL_SetVideoMode</b></i> and they play a strong role in
  29. deciding what modes are valid. For instance, if you pass <b>SDL_HWSURFACE</b> as
  30. a flag only modes that support hardware video surfaces will be returned.
  31.  
  32. <h2><a name='sect3' href='#toc3'>Example</a></h2>
  33. <p>
  34. <br>
  35. <pre>CWSDL_Rect **modes;
  36. int i;
  37. .
  38. .
  39. .
  40. /* Get available fullscreen/hardware modes */
  41. modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
  42. /* Check is there are any modes available */
  43. if(modes == (SDL_Rect **)0){
  44.   printf("No modes available!
  45. ");
  46.   exit(-1);
  47. }
  48. /* Check if or resolution is restricted */
  49. if(modes == (SDL_Rect **)-1){
  50.   printf("All resolutions available.
  51. ");
  52. }
  53. else{
  54.   /* Print valid modes */
  55.   printf("Available Modes
  56. ");
  57.   for(i=0;modes[i];++i)
  58.     printf("  %d x %d
  59. ", modes[i]->w, modes[i]->h);
  60. }
  61. .
  62. .
  63. </pre><p>
  64.  
  65. <h2><a name='sect4' href='#toc4'>See Also</a></h2>
  66. <p>
  67. <i><b>SDL_SetVideoMode</b></i>, <i><b>SDL_GetVideoInfo</b></i>, <i><b>SDL_Rect</b></i>, <i><b>SDL_PixelFormat</b></i> 
  68. <!--
  69.   
  70.  
  71. <p>
  72.  
  73. <hr><p>
  74. <a name='toc'><b>Table of Contents</b></a><p>
  75. <ul>
  76. <li><a name='toc0' href='#sect0'>Name</a></li>
  77. <li><a name='toc1' href='#sect1'>Synopsis</a></li>
  78. <li><a name='toc2' href='#sect2'>Description</a></li>
  79. <li><a name='toc3' href='#sect3'>Example</a></li>
  80. <li><a name='toc4' href='#sect4'>See Also</a></li>
  81. </ul>
  82. </body>
  83. </html>
  84.