Exemple #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     MainForm form = new MainForm();
     form.Show();
     using (MainGame game = new MainGame(form))
     {
         game.Run();
     }
 }
Exemple #2
0
        public MainGame(MainForm form)
        {
            _form = form;
            graphics = new GraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth = _form.ViewportSize.Width,
                PreferredBackBufferHeight = _form.ViewportSize.Height
            };

            graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings;
            System.Windows.Forms.Control.FromHandle(Window.Handle).VisibleChanged += MainGame_VisibleChanged;
            Content.RootDirectory = "Content";
            IsMouseVisible = true;
        }