home *** CD-ROM | disk | FTP | other *** search
- <!-- manual page source format generated by PolyglotMan v3.0.8+X.Org, -->
- <!-- available at http://polyglotman.sourceforge.net/ -->
-
- <html>
- <head>
- <title>"SDL_ListModes"("3") manual page</title>
- </head>
- <body bgcolor='#efefef' text='black' link='blue' vlink='#551A8B' alink='red'>
- <a href='#toc'>Table of Contents</a><p>
-
- <h2><a name='sect0' href='#toc0'>Name</a></h2>
- SDL_ListModes- Returns a pointer to an array of available screen dimensions
- for the given format and video flags
- <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
- <p>
- <b>#include "SDL.h" <p>
- </b><b>SDL_Rect **<b>SDL_ListModes</b></b>(<b>SDL_PixelFormat
- *format, Uint32 flags</b>);
- <h2><a name='sect2' href='#toc2'>Description</a></h2>
- <p>
- Return a pointer to an array of available
- screen dimensions for the given format and video flags, sorted largest
- to smallest. Returns <b>NULL</b> if there are no dimensions available for a particular
- format, or <b>-1</b> if any dimension is okay for the given format. <p>
- If <b>format</b> is
- <b>NULL</b>, the mode list will be for the format returned by <i>SDL_GetVideoInfo()</i>-><b>vfmt</b>.
- The <b>flag</b> parameter is an OR'd combination of <i>surface</i> flags. The flags are
- the same as those used <i><b>SDL_SetVideoMode</b></i> and they play a strong role in
- deciding what modes are valid. For instance, if you pass <b>SDL_HWSURFACE</b> as
- a flag only modes that support hardware video surfaces will be returned.
-
- <h2><a name='sect3' href='#toc3'>Example</a></h2>
- <p>
- <br>
- <pre>CWSDL_Rect **modes;
- int i;
- .
- .
- .
- /* Get available fullscreen/hardware modes */
- modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
- /* Check is there are any modes available */
- if(modes == (SDL_Rect **)0){
- printf("No modes available!
- ");
- exit(-1);
- }
- /* Check if or resolution is restricted */
- if(modes == (SDL_Rect **)-1){
- printf("All resolutions available.
- ");
- }
- else{
- /* Print valid modes */
- printf("Available Modes
- ");
- for(i=0;modes[i];++i)
- printf(" %d x %d
- ", modes[i]->w, modes[i]->h);
- }
- .
- .
- </pre><p>
-
- <h2><a name='sect4' href='#toc4'>See Also</a></h2>
- <p>
- <i><b>SDL_SetVideoMode</b></i>, <i><b>SDL_GetVideoInfo</b></i>, <i><b>SDL_Rect</b></i>, <i><b>SDL_PixelFormat</b></i>
- <!--
-
-
- <p>
-
- <hr><p>
- <a name='toc'><b>Table of Contents</b></a><p>
- <ul>
- <li><a name='toc0' href='#sect0'>Name</a></li>
- <li><a name='toc1' href='#sect1'>Synopsis</a></li>
- <li><a name='toc2' href='#sect2'>Description</a></li>
- <li><a name='toc3' href='#sect3'>Example</a></li>
- <li><a name='toc4' href='#sect4'>See Also</a></li>
- </ul>
- </body>
- </html>
-