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 1203

Summary: SDL_CreateWindow() at fullscreen intransparently picks non-requested resolutions with weird boxing
Product: SDL Reporter: Jonas Thiem <contact>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: Screenshot showing the strange boxing

Description Jonas Thiem 2011-05-08 15:23:05 UTC
Created attachment 610 [details]
Screenshot showing the strange boxing

SDL_CreateWindow() can pick other resolutions than the ones requested, most likely caused by this particular code and possible equivalents in other backends:
https://github.com/bobbens/naev/blob/master/src/opengl.c#L407

Tested with an actual application with 800x600 requested and the closest/smallest resolution available only being 1024x768 on a Linux machine, the result is what can be seen in the screenshot attached.

This state is undesirable and there are two possible paths I see to go from here:

 a) Keep the boxing and continue to pick other resolutions than requested, but fix the boxing to center properly (if it is not centered properly due to something I missed to specify, then sorry for that! I'm quite new to SDL 1.3)
 b) Return NULL for SDL_CreateWindow() and allow the application to do boxing itself or pick another resolution

I'd suggest/prefer going for b) since with NULL returned from SDL_CreateWindow, the unavailability becomes transparent to the application which might then want to try other desirable resolutions (which require no boxing) on its own (or do boxing as it wants to).

To make it easier as an automagical solution, a) with proper centered boxing could still be available optionally through a creation flag passed to SDL_CreateWindow, but it shouldn't be the default I guess (or there should be an easy way like a flag to turn this automagical behaviour off).
Comment 1 Sam Lantinga 2012-01-06 22:35:34 UTC
Can you try with the latest SDL snapshot?
http://www.libsdl.org/tmp/SDL-1.3.zip

I've fixed a bunch of things in that code and it might work now.

Thanks!
Comment 2 Sam Lantinga 2013-05-21 02:38:58 UTC
No response in 2 years, closing bug.

Please feel free to reopen this bug if it's still active in the current snapshot:
http://www.libsdl.org/tmp/SDL-2.0.zip

Thanks!