Switches the screen to the resolution given by
and/or to fullscreen or
window mode. The video_mode, video_screen,
and screen_size variables are automatically set to their
mode - 0 for no change, or the mode number that determines the new screen
resolution (see video_mode).
depth - always 0.
- a combination of the following modes:
0 = no change,
1 = fullscreen,
2 = window,
4 = only set screen_size to the desired resolution, but don't actually change the resolution, A7.7
8 = enforce 4:3 resolutions.
0 if the video mode is not supported, otherwise the number
of the new mode.
||fullscreen or window mode
||height and width in pixel
The video resolution can not be changed before the video device is initialized, which happens in the first frame under lite-C.
- The video resolution can not be changed immediately in an entity or panel event
Use a wait(1) before changing the resolution in an event.
A window - including title bar and border - can not be bigger
than the desktop.
Thus setting a 1024x768 window on a 1024x768 desktop will always fail unless you remove border and title bar.
For setting arbitrary resolutions in window mode,
- Switching between fullscreen and window mode and at the same time
to a different resolution might require two steps when the current
or desired resolution is the same as the desktop resolution.
Imagine you're at 1024x768 fullscreen and your desktop is also at
1024x786, and you want to switch to 600x800 window mode. This requires
two steps: first, switching from fullscreen to window mode, and
second, setting the resolution at 800x600. The first step fails
because a 1024x758 window plus title bar is bigger than the desktop. Thus video_switch returns 0. You need to switch to 600x800 fullscreen first, and then you can switch to window mode:
On a multi-monitor system, fullscreen video modes are normally opened on the primary monitor
unless a different monitor is selected by the -mon command line option.
if(video_switch(7,0,0) == 0)
screen_size, video_window, video_set