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 - API for setting display window size independently of hardware resolution
Summary: API for setting display window size independently of hardware resolution
Status: RESOLVED WONTFIX
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.11
Hardware: All All
: P2 enhancement
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-15 01:18 UTC by Mike B
Modified: 2006-09-24 11:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.