| Summary: | Strange behaviour of SDL_SetVideoMode when using it to change between FULL_SCREEN and Windowed | ||
|---|---|---|---|
| Product: | sdl12-compat | Reporter: | Dario <dankospam> |
| Component: | everything | Assignee: | Ryan C. Gordon <icculus> |
| Status: | NEW --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | unspecified | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
Patch to resolve described issue.
A video showing game behaviour with submitted patch. A video showing game behaviour without patch |
||
Created attachment 3709 [details]
A video showing game behaviour with submitted patch.
Created attachment 3710 [details]
A video showing game behaviour without patch
|
Created attachment 3708 [details] Patch to resolve described issue. I have a game that uses SDL_SetVideMode to run on SDL_FULLSCREEN mode on a 2560x1440. The non-scaled resolution of the game when running in fullscreen is 1280x720. The game allows using non-full screen mode, and with GDB I have seen it results invoking SDL_SetVideoMode again without the SDL_FULLSCREEN flag. The target size of the window is 640 x 360. For some reason, when switching from full screen to windowed, the "surface" does not get resized. It remains at 2560x1440 which results in a clipped area. When SDL_SetVideoMode is invoked a second time with the 640x360 Windowed, the contents are resized correctly. I was able to overcome this problem by forcing a EnvVidModeCreate() when the target width and height does not match the width and height that VideoSurface12 contained. See patch. There might be however a better way of resolving this. I tried to do a lot of debugging but this is as far I could get :).