When I attempt to run my game, game.Run() appears to be doing nothing. It doesn’t open a window and returns an error code of 0. I put some WriteLine()s to check whether the game starts, and they both get called and print… My game was working and I can’t figure what (if anything) I did to break it. I don’t even call Game.Exit() anywhere in my code.
public static void Main(string[] args)
{
Console.WriteLine("GAME START");
var game = new Game();
game.Run();
Console.WriteLine("GAME END");
}
I’m running the latest MonoGame 3.8, Windows, and it’s a WindowsDX project.
OK, the problem thickens. I switched from referencing the WindowsDX MonoGame to DesktopGL which somehow got my game working again, only to make it so I can’t set the window size? Again, working before. Using PreferredBackBuffer*.
Thanks for your help, it works now! Any idea why WindowsDX broke and why I can’t change window size in the constructor? Should I open two issues on Github?
You can’t change window size in the constructor because the GraphicsDevice is only instantiated between calling the constructor and calling the Initialize method of the game class.