We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4140 - fullscreen_width and fullscreen_height variables are ignored
Summary: fullscreen_width and fullscreen_height variables are ignored
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.8
Hardware: x86_64 Windows 7
: P2 blocker
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-18 10:43 UTC by zodomaniac
Modified: 2018-05-09 16:48 UTC (History)
1 user (show)

See Also:


Attachments
fullscreen_width and fullscreen_height should limit the game picture size like this but they don't. (498.39 KB, image/png)
2018-04-18 10:43 UTC, zodomaniac
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zodomaniac 2018-04-18 10:43:37 UTC
Created attachment 3225 [details]
fullscreen_width and fullscreen_height should limit the game picture size like this but they don't.

I set the fullscreen_width to 1728 and fullscreen_height to 1080 in Chocolate Doom config file and expected the game to be rendered fullscreen with black bars on the sides as my monitor is 1920x1080 (like in the provided screenshot), but the picture was stretched full screen instead.
Comment 1 Fabian Greffrath 2018-05-09 16:48:56 UTC
I should probably provide some more context to this (Chocolate Doom dev).

Usually, if a user chooses to play the game in fullscreen, we set the SDL_WINDOW_FULLSCREEN_DESKTOP flag, because we assume the player wants to keep his desktop resolution and simply have the game cover the whole screen.

However, there are two variables, fullscreen_width and fullscreen_height, which the user may set in the config file to express that he wants to play the game in fullscreen *in a specific screen resolution*. In that case, we set the SDL_WINDOW_FULLSCREEN flag, instead. Later on, we pass the width and height variables along with the flags to SDL_CreateWindow().

What we expect from this function in the latter case is to switch the screen to the given resolution - or the next highest one and and render the game in a centered area of the given dimensions surrounded by a black border.

The code which is supposed to do what I just described can be found here:

https://github.com/chocolate-doom/chocolate-doom/blob/master/src/i_video.c#L1145


However, we had reports from a Windows user that this doesn't work as intended. The downstream bug report is here:

https://github.com/chocolate-doom/chocolate-doom/issues/1010

I can confirm it doesn't work as described on Linux with Wayland as well, whereas another user reported the feature to work on a Mac.

Hope you can get after it!

Best regards,

 - Fabian