Manpage of SDL_SetVideoMode
SDL_SetVideoMode
Index
NAME
SDL_SetVideoMode- Set up a video mode with the specified width, height and bits-per-pixel&.
SYNOPSIS
fB#include "SDL&.h"
fBSDL_Surface *fBSDL_SetVideoModefPfR(fBint width, int height, int bpp, Uint32 flagsfR);
DESCRIPTION
Set up a video mode with the specified width, height and bits-per-pixel&.
If fBbppfR is 0, it is treated as the current display bits per pixel&.
The fBflagsfR parameter is the same as the fBflagsfR field of the fIfBSDL_SurfacefRfR structure&. OR&'d combinations of the following values are valid&.
- fBSDL_SWSURFACEfP
-
Create the video surface in system memory
- fBSDL_HWSURFACEfP
-
Create the video surface in video memory
- fBSDL_ASYNCBLITfP
-
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&.
- fBSDL_ANYFORMATfP
-
Normally, if a video surface of the requested bits-per-pixel (fBbppfR) is not available, SDL will emulate one with a shadow surface&. Passing fBSDL_ANYFORMATfP prevents this and causes SDL to use the video surface, regardless of its pixel depth&.
- fBSDL_HWPALETTEfP
-
Give SDL exclusive palette access&. Without this flag you may not always get the the colors you request with fIfBSDL_SetColorsfPfR or fIfBSDL_SetPalettefPfR&.
- fBSDL_DOUBLEBUFfP
-
Enable hardware double buffering; only valid with SDL_HWSURFACE&. Calling fIfBSDL_FlipfPfR 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 fBSDL_FlipfP will just perform a fIfBSDL_UpdateRectfPfR on the entire screen&.
- fBSDL_FULLSCREENfP
-
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&.
- fBSDL_OPENGLfP
-
Create an OpenGL rendering context&. You should have previously set OpenGL video attributes with fIfBSDL_GL_SetAttributefPfR&.
- fBSDL_OPENGLBLITfP
-
Create an OpenGL rendering context, like above, but allow normal blitting operations&. The screen (2D) surface may have an alpha channel, and fIfBSDL_UpdateRectsfPfR must be used for updating changes to the screen surface&.
- fBSDL_RESIZABLEfP
-
Create a resizable window&. When the window is resized by the user a fIfBSDL_VIDEORESIZEfPfR event is generated and fBSDL_SetVideoModefP can be called again with the new size&.
- fBSDL_NOFRAMEfP
-
If possible, fBSDL_NOFRAMEfP causes SDL to create a window with no title bar or frame decoration&. Fullscreen modes automatically have this flag set&.
-
fBNote:
Whatever fBflagsfR fBSDL_SetVideoModefP could satisfy are set in the fBflagsfR member of the returned surface&.
-
fBNote:
The fBbppfR parameter is the number of bits per pixel, so a fBbppfR of 24 uses the packed representation of 3 bytes/pixel&. For the more common 4 bytes/pixel mode, use a fBbppfR of 32&. Somewhat oddly, both 15 and 16 will request a 2 bytes/pixel mode, but different pixel formats&.
RETURN VALUE
The framebuffer surface, or fBNULLfR if it fails&. The surface returned is freed by SDL_Quit() and should nt be freed by the caller&.
SEE ALSO
fIfBSDL_LockSurfacefPfR, fIfBSDL_SetColorsfPfR, fIfBSDL_FlipfPfR, fIfBSDL_SurfacefRfR
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUE
-
- SEE ALSO
-
|