SDL_SetVideoMode − Set up a video mode with the specified width, height and bits-per-pixel.


#include "SDL.h"

SDL_Surface *SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);


Set up a video mode with the specified width, height and bits-per-pixel.

If bpp is 0, it is treated as the current display bits per pixel.

The flags parameter is the same as the flags field of the SDL_Surface structure. OR’d combinations of the following values are valid.


Create the video surface in system memory


Create the video surface in video memory


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.


Normally, if a video surface of the requested bits-per-pixel (bpp) is not available, SDL will emulate one with a shadow surface. Passing SDL_ANYFORMAT prevents this and causes SDL to use the video surface, regardless of its pixel depth.


Give SDL exclusive palette access. Without this flag you may not always get the the colors you request with SDL_SetColors or SDL_SetPalette.


Enable hardware double buffering; only valid with SDL_HWSURFACE. Calling SDL_Flip 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 SDL_Flip will just perform a SDL_UpdateRect on the entire screen.


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.


Create an OpenGL rendering context. You should have previously set OpenGL video attributes with SDL_GL_SetAttribute.


Create an OpenGL rendering context, like above, but allow normal blitting operations. The screen (2D) surface may have an alpha channel, and SDL_UpdateRects must be used for updating changes to the screen surface.


Create a resizable window. When the window is resized by the user a SDL_VIDEORESIZE event is generated and SDL_SetVideoMode can be called again with the new size.


If possible, SDL_NOFRAME causes SDL to create a window with no title bar or frame decoration. Fullscreen modes automatically have this flag set.


Whatever flags SDL_SetVideoMode could satisfy are set in the flags member of the returned surface.


The bpp parameter is the number of bits per pixel, so a bpp of 24 uses the packed representation of 3 bytes/pixel. For the more common 4 bytes/pixel mode, use a bpp of 32. Somewhat oddly, both 15 and 16 will request a 2 bytes/pixel mode, but different pixel formats.


The framebuffer surface, or NULL if it fails. The surface returned is freed by SDL_Quit() and should nt be freed by the caller.


SDL_LockSurface, SDL_SetColors, SDL_Flip, SDL_Surface

More Linux Commands

winch(3ncurses) - get a character and attributes from a curs
These routines return the character, of type chtype, at the current position in the named window. If any attributes are set for that position, their values are

getsysinfo(1) (Commands - Linux manual page)...............
Collect some system data that are useful for debugging hardware detection bugs. General Commands Manual getsysinfo.1 (User Commands Section - Linux manual page)

gnutls_x509_crq_get_key_rsa_raw(3) - API function (ManPage)
gnutls_x509_crq_get_key_rsa_raw.3 - This function will export the RSA public keys parameters found in the given structure. The new parameters will be allocated

mysqlbinlog(1) - utility for processing binary log files....
The servers binary log consists of files containing events that describe modifications to database contents. The server writes these files in binary format. To

XExposeEvent(3) - Expose event structure - Linux man page...
The structure for Expose events contains: typedef struct { int type; /* Expose */ unsigned long serial; /* # of last request processed by server */ Bool send_ev

logprof(8) utility for updating AppArmor security profiles
aa-logprof is an interactive tool used to review AppArmor generated messages and update AppArmor security profiles. Running aa-logprof will scan the log file an

form_new(3form) - create and destroy forms - Linux man page
The function new_form creates a new form connected to a specified field pointer array (which must be NULL-terminated). The function free_form disconnects form f

gslp(1) - Format and print text using ghostscript (ManPage)
This utility provides functionality approximately equivalent to the Unix enscript(1) program. It prints plain text files using a single font. It currently handl

pam_get_item(3) - getting PAM informations - Linux man page
The pam_get_item function allows applications and PAM service modules to access and retrieve PAM informations of item_type. Upon successful return, item contain

intel_gpu_top(1) - Display a top-like summary of Intel GPU u
intel_gpu_top is a tool to display usage information of an Intel GPU. It requires root privilege to map the graphics device. Options -s [samples per second] num

mrtg-rrd(1) How to use RRDtool with MRTG - Linux man page...
When using mrtg with RRDtool you are replacing rateup with the RRDtool perl module To enable RRDtool support in mrtg you have to add the line LogFormat

getcontext(3) get or set the user context - Linux man page
In a System V-like environment, one has the two types mcontext_t and ucontext_t defined in <ucontext.h> and the four functions getcontext(), setcontext(), makec

We can't live, work or learn in freedom unless the software we use is free.