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_SetVideoMode"("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_SetVideoMode- Set up a video mode with the specified width, height
- and bits-per-pixel.
- <h2><a name='sect1' href='#toc1'>Synopsis</a></h2>
- <p>
- <b>#include "SDL.h" <p>
- </b><b>SDL_Surface *<b>SDL_SetVideoMode</b></b>(<b>int
- width, int height, int bpp, Uint32 flags</b>);
- <h2><a name='sect2' href='#toc2'>Description</a></h2>
- <p>
- Set up a video mode
- with the specified width, height and bits-per-pixel. <p>
- If <b>bpp</b> is 0, it is treated
- as the current display bits per pixel. <p>
- The <b>flags</b> parameter is the same as
- the <b>flags</b> field of the <i><b>SDL_Surface</b></i> structure. OR'd combinations of the following
- values are valid.
- <dl>
-
- <dt><b>SDL_SWSURFACE</b> </dt>
- <dd>Create the video surface in system memory
- </dd>
-
- <dt><b>SDL_HWSURFACE</b> </dt>
- <dd>Create the video surface in video memory </dd>
-
- <dt><b>SDL_ASYNCBLIT</b> </dt>
- <dd>Enables
- the use of asynchronous updates of the display surface. This will usually
- slow down blitting on single CPU machines, but may provide a speed increase
- on SMP systems. </dd>
-
- <dt><b>SDL_ANYFORMAT</b> </dt>
- <dd>Normally, if a video surface of the requested
- bits-per-pixel (<b>bpp</b>) is not available, SDL will emulate one with a shadow
- surface. Passing <b>SDL_ANYFORMAT</b> prevents this and causes SDL to use the video
- surface, regardless of its pixel depth. </dd>
-
- <dt><b>SDL_HWPALETTE</b> </dt>
- <dd>Give SDL exclusive
- palette access. Without this flag you may not always get the the colors
- you request with <i><b>SDL_SetColors</b></i> or <i><b>SDL_SetPalette</b></i>. </dd>
-
- <dt><b>SDL_DOUBLEBUF</b> </dt>
- <dd>Enable hardware
- double buffering; only valid with SDL_HWSURFACE. Calling <i><b>SDL_Flip</b></i> will flip
- the buffers and update the screen. All drawing will take place on the surface
- that is not displayed at the moment. If double buffering could not be enabled
- then <b>SDL_Flip</b> will just perform a <i><b>SDL_UpdateRect</b></i> on the entire screen. </dd>
-
- <dt><b>SDL_FULLSCREEN</b>
- </dt>
- <dd>SDL will attempt to use a fullscreen mode. If a hardware resolution change
- is not possible (for whatever reason), the next higher resolution will
- be used and the display window centered on a black background. </dd>
-
- <dt><b>SDL_OPENGL</b>
- </dt>
- <dd>Create an OpenGL rendering context. You should have previously set OpenGL
- video attributes with <i><b>SDL_GL_SetAttribute</b></i>. </dd>
-
- <dt><b>SDL_OPENGLBLIT</b> </dt>
- <dd>Create an OpenGL
- rendering context, like above, but allow normal blitting operations. The
- <a href='screen.2.html'>screen (2D)</a>
- surface may have an alpha channel, and <i><b>SDL_UpdateRects</b></i> must
- be used for updating changes to the screen surface. </dd>
-
- <dt><b>SDL_RESIZABLE</b> </dt>
- <dd>Create
- a resizable window. When the window is resized by the user a <i><b>SDL_VIDEORESIZE</b></i>
- event is generated and <b>SDL_SetVideoMode</b> can be called again with the new
- size. </dd>
-
- <dt><b>SDL_NOFRAME</b> </dt>
- <dd>If possible, <b>SDL_NOFRAME</b> causes SDL to create a window
- with no title bar or frame decoration. Fullscreen modes automatically have
- this flag set. </dd>
- </dl>
- <p>
- <blockquote><b>Note: <p>
- Whatever <b>flags</b></b> <b>SDL_SetVideoMode</b> could satisfy are
- set in the <b>flags</b> member of the returned surface. </blockquote>
- <p>
- <blockquote><b>Note: <p>
- The <b>bpp</b></b> parameter
- is the number of bits per pixel, so a <b>bpp</b> of 24 uses the packed representation
- of 3 bytes/pixel. For the more common 4 bytes/pixel mode, use a <b>bpp</b> of 32.
- Somewhat oddly, both 15 and 16 will request a 2 bytes/pixel mode, but different
- pixel formats. </blockquote>
-
- <h2><a name='sect3' href='#toc3'>Return Value</a></h2>
- <p>
- The framebuffer surface, or <b>NULL</b> if it fails.
- The surface returned is freed by SDL_Quit() and should nt be freed by the
- caller.
- <h2><a name='sect4' href='#toc4'>See Also</a></h2>
- <p>
- <i><b>SDL_LockSurface</b></i>, <i><b>SDL_SetColors</b></i>, <i><b>SDL_Flip</b></i>, <i><b>SDL_Surface</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'>Return Value</a></li>
- <li><a name='toc4' href='#sect4'>See Also</a></li>
- </ul>
- </body>
- </html>
-