Exemple #1
0
        public void InitializeDevice(GameApp gameapp)
        {
            PresentParameters presentparameter = new PresentParameters();

            presentparameter.Windowed   = true;
            presentparameter.SwapEffect = SwapEffect.Discard;
            Device = new Device(0, DeviceType.Hardware, gameapp, CreateFlags.HardwareVertexProcessing, presentparameter);
        }
Exemple #2
0
 public static GameApp GetGameApp()
 {
     if (_gameapp == null)
     {
         _gameapp = new GameApp();
     }
     return(_gameapp);
 }
        public void OnNotify(Event ievent)
        {
            if (ievent is KeyPressedEvent)
            {
                if (((KeyPressedEvent)ievent).key == Keys.key.Escape)
                {
                    MethodInvoker inv = delegate
                    {
                        GameApp.GetGameApp().Close();
                    };

                    GameApp.GetGameApp().Invoke(inv);
                }
            }
        }
Exemple #4
0
 public void Update(GameApp gameapp)
 {
     InputManager.GetInputManager().GetKey();
     StateManager.GetStateManager().GetCurrentState().Update();
 }
Exemple #5
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(GameApp.GetGameApp());
 }