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)
var game = new Game();
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?
i have no idea. You should ask the devs, or maybe indeed open issues on Github. But nice to hear that it works now
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.
It does work but you are doing it wrong. It runs off a tick for starts. use this:
static void Main(string args)
using(var game = new App())
public class App : Game
graphics = new GraphicsDeviceManager(this);