
Cannot get WindowState to change
Posted Friday, 19 August, 2011 - 23:37 by account_deleted inEdit: This was a mistake on my part, and has been fixed. I was trying to set the window state in Main.
Going through the OpenTK lessons, I tried to set up a fullscreen window:
using System; using OpenTK; using OpenTK.Graphics; private static void Main(string[] args) { using(GameWindow game = new GameWindow(640, 420, GraphicsMode.Default, "title")) { game.WindowState = WindowState.Fullscreen; Console.WriteLine(game.WindowState); game.Run(60.0, 60.0); } }
The program would not go into fullscreen, but would not generate any errors or exceptions. The "Console.WriteLine" was added to see if the window state was changing at all, which it was not. The same happened with maximizing and minimizing.
running OpenSUSE 11.4 GNOME with Metacity/Compiz
Mono 2.8.2
latest OpenTK release as of Aug 19, 2011
I'm suspecting this a problem with my code or OpenTK as I'm able to put MonoDevelop in fullscreen without a problem.


Comments
Re: Cannot get WindowState to change
Try setting it in the GameWindow.Load event.
Re: Cannot get WindowState to change
Thank you. That fixed my problem completely.
Re: Cannot get WindowState to change
Changing the Windowstate hast to be done after Game.Run.
Re: Cannot get WindowState to change
Explanation here: http://www.opentk.com/node/2660#comment-12499