account_deleted's picture

Cannot get WindowState to change

Edit: 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;
        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.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Xeethrax's picture

Try setting it in the GameWindow.Load event.

account_deleted's picture

Thank you. That fixed my problem completely.

Stupid_2D's picture

Changing the Windowstate hast to be done after Game.Run.

the Fiddler's picture