home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !SDL / man / SDL_VideoModeOK.3 < prev    next >
Encoding:
Text File  |  2006-09-20  |  2.0 KB  |  72 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_VideoModeOK"("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_VideoModeOK- Check to see if a particular video mode is supported.
  13.  
  14. <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
  15. <p>
  16. <b>#include "SDL.h" <p>
  17. </b><b>int <b>SDL_VideoModeOK</b></b>(<b>int width, int height, int
  18. bpp, Uint32 flags</b>); 
  19. <h2><a name='sect2' href='#toc2'>Description</a></h2>
  20. <p>
  21. <b>SDL_VideoModeOK</b> returns <b>0</b> if the requested
  22. mode is not supported under any bit depth, or returns the bits-per-pixel
  23. of the closest available mode with the given width, height and requested
  24. <i>surface</i> flags (see <i><b>SDL_SetVideoMode</b></i>). <p>
  25. The bits-per-pixel value returned is
  26. only a suggested mode. You can usually request and bpp you want when <i>setting</i>
  27. the video mode and SDL will emulate that color depth with a shadow video
  28. surface. <p>
  29. The arguments to <b>SDL_VideoModeOK</b> are the same ones you would pass
  30. to <i>SDL_SetVideoMode</i> 
  31. <h2><a name='sect3' href='#toc3'>Example</a></h2>
  32. <p>
  33. <br>
  34. <pre>CWSDL_Surface *screen;
  35. Uint32 bpp;
  36. .
  37. .
  38. .
  39. printf("Checking mode 640x480@16bpp.
  40. ");
  41. bpp=SDL_VideoModeOK(640, 480, 16, SDL_HWSURFACE);
  42. if(!bpp){
  43.   printf("Mode not available.
  44. ");
  45.   exit(-1);
  46. }
  47. printf("SDL Recommends 640x480@%dbpp.
  48. ", bpp);
  49. screen=SDL_SetVideoMode(640, 480, bpp, SDL_HWSURFACE);
  50. .
  51. .
  52. </pre><p>
  53.  
  54. <h2><a name='sect4' href='#toc4'>See Also</a></h2>
  55. <p>
  56. <i><b>SDL_SetVideoMode</b></i>, <i><b>SDL_GetVideoInfo</b></i> 
  57. <!--
  58.   
  59.  <p>
  60.  
  61. <hr><p>
  62. <a name='toc'><b>Table of Contents</b></a><p>
  63. <ul>
  64. <li><a name='toc0' href='#sect0'>Name</a></li>
  65. <li><a name='toc1' href='#sect1'>Synopsis</a></li>
  66. <li><a name='toc2' href='#sect2'>Description</a></li>
  67. <li><a name='toc3' href='#sect3'>Example</a></li>
  68. <li><a name='toc4' href='#sect4'>See Also</a></li>
  69. </ul>
  70. </body>
  71. </html>
  72.