protected override void InitializeBeforeRun() { if (Headless) { _graphicsDevice = new D3D11GraphicsDevice(new System.Drawing.Size(800, 600)); } else { _graphicsDevice = new D3D11GraphicsDevice(MainWindow !); _directInputDevice = new DIInputDevice(); _directInputDevice.Initialise(MainWindow.Handle); } }
public static void Main() { DIInputDevice directInputDevice = new DIInputDevice(); directInputDevice.Initialize(IntPtr.Zero); while (true) { if (Console.KeyAvailable) { switch (Console.ReadKey(true).KeyChar) { case 'q': return; } } directInputDevice.GetKeyboardUpdates(); directInputDevice.GetKJoystickUpdates(); } }