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 302

Summary: API for setting display window size independently of hardware resolution
Product: SDL Reporter: Mike B <mbandsmer>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED WONTFIX QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2    
Version: 1.2.11   
Hardware: All   
OS: All   

Description Mike B 2006-08-15 01:18:56 UTC
This is not a bug, but a request for a new feature, based on mail threads here <http://www.libsdl.org/pipermail/sdl/2006-August/075802.html> and here <http://www.libsdl.org/pipermail/sdl/2006-August/075863.html>.

It would be useful to have a way to set the display window size independently of the physical hardware display resolution.  I.e. an API function something like this:

SDL_Surface *SDL_SetVideoModeCustom(int physicalScreenWidth, int physicalScreenHeight, int displayWidth, int displayHeight, int bpp, Uint32 flags);

This would use displayWidth and displayHeight for the dimensions of a
display window, to be centered on a fullscreen hardware resolution of
physicalScreenWidth by physicalScreenHeight.

Access to physicalScreen(Width|Height) through environment variables could also be useful to the end user.

There are at least 2 use cases:
(1) To maintain the correct pixel aspect ratio for widescreen or tall LCD's, e.g. to always use the LCD's native resolution.
(2) To make the display window smaller for massive displays at normal desktop viewing distances, e.g. for fast action games where it could be hard to see all parts of a massive display at once.

While there may be workarounds for these use cases, mouse-cursor handling becomes very kludgy---it would be very nice to take advantage of SDL's automatic constraining of the mouse cursor position to stay within the display window in these cases.
Comment 1 Sam Lantinga 2006-09-24 11:58:45 UTC
This is already available in the SDL 1.3 API, where the concept of window size and resolution size are split.