mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Pull the major release card and switch the semantics of vid_fullscreen
One of the most common bug reports is, that the fullscreen mode doesn't behave like users expect. This is caused by `vid_fullscreen 1` setting desktop fullscreen mode (a fullscreen windows) and not the native fullscreen mode. This commits switches the semantics: * 1: Native fullscreen, like Vanilla Quake II. * 2: Desktop fullscreen. With this alt-tab reverts to native fullscreen. While at it improve the documentation, suggest setting `r_mode -2` when using `vid_fullscreen 2`. Change the menu strings to make things clearer, set `r_mode -2` when selecting 'fullscreen window' in the menu. I pondered several other options: * Introducing a second cvar for the desktop fullscreen, like we did in dhewm3. This has the problem, that in Quake II vi_fullscreen is special and used to communicate changed to the renderer configuration between the client and renderer. A second fullscreen cvar would complicate this already shaky mechanism even more. * Setting `r_mode -2` when `vid_fullscreen 2`. This might not be what the user wants and causes problems when we're unable to get the desktop resolution.
This commit is contained in:
parent
51caf5b85e
commit
f1b6b82721
3 changed files with 19 additions and 6 deletions
|
@ -281,6 +281,14 @@ it's `+set busywait 0` (setting the `busywait` cvar) and `-portable`
|
|||
apply this to the window in realtime via shaders (on all platforms).
|
||||
This is also set by the brightness slider in the video menu.
|
||||
|
||||
* **vid_fullscreen**: Sets the fullscreen mode. When set to `0` (the
|
||||
default) the game runs in window mode. When set to `1` the games
|
||||
switches the display to the requested resolution. That resolution
|
||||
must be supported by the display, otherwise the game tries several
|
||||
steps to recover. When set to `2` a fullscreen window is created.
|
||||
It's recommended to use the displays native resolution with the
|
||||
fullscreen window, use `r_mode -2` to switch to it.
|
||||
|
||||
* **vid_maxfps**: The maximum framerate, if `cl_async` is `1`. Otherwise
|
||||
`cl_maxfps` is used as maximum framerate. See `cl_async` description
|
||||
above for more information. *Note* that vsync (`r_vsync`) also
|
||||
|
|
|
@ -236,6 +236,11 @@ ApplyChanges(void *unused)
|
|||
/* Restarts automatically */
|
||||
Cvar_SetValue("vid_fullscreen", s_fs_box.curvalue);
|
||||
|
||||
if (s_fs_box.curvalue == 2)
|
||||
{
|
||||
Cvar_SetValue("r_mode", -2.0f);
|
||||
}
|
||||
|
||||
/* vertical sync */
|
||||
if (r_vsync->value != s_vsync_list.curvalue)
|
||||
{
|
||||
|
@ -344,8 +349,8 @@ VID_MenuInit(void)
|
|||
|
||||
static const char *fullscreen_names[] = {
|
||||
"no",
|
||||
"keep resolution",
|
||||
"switch resolution",
|
||||
"native fullscreen",
|
||||
"fullscreen window",
|
||||
0
|
||||
};
|
||||
|
||||
|
|
|
@ -219,11 +219,11 @@ GetFullscreenType()
|
|||
{
|
||||
if (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN_DESKTOP)
|
||||
{
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
else if (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN)
|
||||
{
|
||||
return 2;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -457,11 +457,11 @@ GLimp_InitGraphics(int fullscreen, int *pwidth, int *pheight)
|
|||
|
||||
if (fullscreen == 1)
|
||||
{
|
||||
fs_flag = SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
fs_flag = SDL_WINDOW_FULLSCREEN;
|
||||
}
|
||||
else if (fullscreen == 2)
|
||||
{
|
||||
fs_flag = SDL_WINDOW_FULLSCREEN;
|
||||
fs_flag = SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
}
|
||||
|
||||
/* Only do this if we already have a working window and a fully
|
||||
|
|
Loading…
Reference in a new issue