Esempio n. 1
0
 static void Main()
 {
     using (var form = new EditorForm())
     {
         using (var game = new GameEx(form.constructEditor, form.startEditor, form.loadEditor, form.updateEditor, form.drawEditor))
         {
             form.Show();
             game.Run();
         }
     }
 }
        internal void Construct(GameEx game)
        {
            form.GameApp = game;
            this.game    = game;
            Form f = Control.FromHandle(game.Window.Handle) as Form;

            mouseState        = new EditorMouseState(drawingSurface);
            form.FormClosing += (s, e) => f.Close();
            game.graphics.PreparingDeviceSettings +=
                new EventHandler <PreparingDeviceSettingsEventArgs>((s, e) => e.GraphicsDeviceInformation.PresentationParameters.DeviceWindowHandle = drawingSurface.Handle);
            f.VisibleChanged += (s, e) => f.Visible = false;
        }