video_switch (var res,var depth,var window)

Switches the screen to the resolution given by res, to the color depth given by depth and to fullscreen (window = 1) and window mode (window = 2). 0 means no change for either parameter. The video_mode, video_depth, video_screen, and screen_size variables are automatically set to their new values.

Parameters:

res - video mode number that determines the screen resolution.
0 no change
1 320x200 (legacy)
2 320x240 (legacy)
3 320x400 (legacy)
4 400x300 (legacy)
5 512x384 (legacy)
6 640x480 (flythrough default mode)
7 800x600
8 1024x768
9 1280x1024
10 1400x1050
11 1600x1200
12 1920x1200

depth - color depth
0 no change
16 16 bit / high color
32 32 bit / true color

window - fullscreen or window mode
0 no change
1 fullscreen
2 window

Returns:

0 if the video mode can't be set, otherwise the number of the new mode.

Modifies:

video_mode new resolution
video_depth new color depth
video_screen fullscreen or window mode
screen_size height and width in pixel

Speed:

Slow

Remarks:

video_set(800,600,0,0);
video_set(0,0,0,2);

Example:

if(video_switch(7,0,0) == 0)
{
   video_switch(6,0,0);
}   

See also:

video_mode, video_depth, video_screen, screen_size, video_window, video_set

► latest version online