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

Summary: OpenGL surface returned by SDL_SetVideoMode may have different dimensions
Product: SDL Reporter: Maarten ter Huurne <maarten>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED DUPLICATE QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 1.2.14   
Hardware: All   
OS: All   

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 ***