Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Unable to toggle full screen using WindowsGL #1754
I want to have an options screen in my game that will allow the user to toggle full screen and change resolutions, but I'm running into problems.
I'm using the WindowsGL build on Windows 7, and am using Visual Studio 2010.
To test the issue, I created a new MonoGame project, and in
and then made the spacebar toggle full screen in
Pressing space the first time successfully switches to full screen. Pressing it again exits full screen, but leaves my screen's resolution the same size (1366x768 instead of 1680x1050):
That was using the MonoGame.Framework.dll that's located in C:\Program Files (x86)\MonoGame\v3.0\Assemblies\WindowsGL
I've also tried cloning the
I apologize if this issue has been mentioned before. I used search and couldn't find anything.
Here is the complete code I'm using to test this: https://gist.github.com/klutch/5652781
Wanted to see if this was still a problem in MonoGame. I have this fix that I want to pull for MG-SDL2->upstream...
I think this was the issue that sparked it? I swear there was another Cornflower Blue issue that was related to this...
Just need to be sure that I'm referencing the right issues when I submit this block of code to the core team.
For anyone interested, I think this might be two separate issues. The first issue is toggling full screen does nothing after the first toggle. The second issue is not restoring the resolution when exiting fullscreen.
I was able to fix the issues with subsequent toggles not working by adding this line to the bottom of OpenTKGameWindows's ToggleFullscreen method:
For the second issue, I think it's a bug in OpenTK. I ran into this forum post which seems to describe the exact problem I'm having: http://www.opentk.com/node/2840
The ResetWindowBounds method in OpenTKGamePlatform makes a call to
The ToggleFullscreen issue might just be the fault of how we do ToggleFullscreen in
The second issue... yeah, good ol' OpenTK. Though if we don't need the