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); }
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); } } }
public void Update(GameApp gameapp) { InputManager.GetInputManager().GetKey(); StateManager.GetStateManager().GetCurrentState().Update(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(GameApp.GetGameApp()); }