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 3525

Summary: GL with SDL_SetWindowFullscreen wierd behavior
Product: SDL Reporter: Marco <marcopuzziello>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2 CC: jopadan
Version: 2.0.5   
Hardware: x86_64   
OS: Windows 10   
Attachments: described in the comment

Description Marco 2016-12-17 23:31:35 UTC
Created attachment 2650 [details]
described in the comment

First I create a window with only (SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL) and create the GL context. After that i issue a few OpenGL commands (glViewport, glClearColor, ...) and enter the render loop. Inside the loop I first check for the F key press which toggles the fullscreen mode then continues to render the triangle and swap the buffers.

Then i hit F once to enter fullscreen mode and heres the problem now: when i hit F again to leave fullscreen mode the OpenGL viewport will be displaced to the top left corner as if there was no title bar nor border. I will attach the same exact code I'm running with a Screenshot showing the window at startup and the window after the fullscreen toggling. I'm using Visual Studio 2015 Community.
Comment 1 Jon Daniel 2019-06-21 19:45:44 UTC
Try the workaround at https://bugzilla.libsdl.org/show_bug.cgi?id=3524#c1 it seems to be a similar problem.