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 979 - OpenGL surface returned by SDL_SetVideoMode may have different dimensions
Summary: OpenGL surface returned by SDL_SetVideoMode may have different dimensions
Status: RESOLVED DUPLICATE of bug 422
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.14
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-01 03:30 UTC by Maarten ter Huurne
Modified: 2011-12-29 01:19 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 Maarten ter Huurne 2010-04-01 03:30:42 UTC
When requesting a non-GL mode from SDL_SetVideoMode, it is guaranteed that the returned surface will have the exact same width and height as was requested. With an OpenGL mode, that is not the case.

See src/video/SDL_video.c, line 701: (in SDL 1.2.14)

  if ( (mode != NULL) && (!is_opengl) ) {
    ...
    /* Now adjust the offsets to match the desired mode */
    ...

The implementation of this correction is specific to non-GL surfaces. However, there is no matching correction implemented for GL surfaces. As a result, when I ask for a 960x720 full screen OpenGL surface, I get a 1024x768 surface, since that is the smallest mode that fits 960x720 that the system can provide.
Comment 1 Maarten ter Huurne 2010-04-01 03:44:14 UTC
Hmmm, this might be the same issue as bug 422.

If it cannot be fixed easily, please make the fact that the returned surface can be larger than requested part of the SDL_SetVideoMode API and document it. That way, the application programmer knows that he/she should handle this instead of SDL.
Comment 2 Sam Lantinga 2011-12-29 01:19:17 UTC

*** This bug has been marked as a duplicate of bug 422 ***