| Summary: | OpenGL surface returned by SDL_SetVideoMode may have different dimensions | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Maarten ter Huurne <maarten> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED DUPLICATE | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 1.2.14 | ||
| Hardware: | All | ||
| OS: | All | ||
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. |
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.