protected override void OnKeyDown(KeyboardKeyEventArgs e) { // close window on escape press if (e.Key == Keys.Escape) { Close(); } // reset camera to default position and orientation on R press if (e.Key == Keys.R) { Camera.ResetToDefault(); } }
private void OnKeyDown(object sender, KeyboardKeyEventArgs e) { // close window on escape press if (e.Key == Key.Escape) { Close(); } // reset camera to default position and orientation on R press if (e.Key == Key.R) { Camera.ResetToDefault(); } }
public ExampleWindow() : base(GameWindowSettings.Default, new NativeWindowSettings() { Size = new Vector2i(800, 600), Title = "" }) { // disable vsync VSync = VSyncMode.Off; // set up camera Camera = new Camera(); Camera.SetBehavior(new ThirdPersonBehavior(this)); Camera.DefaultState.Position.Z = 5; Camera.ResetToDefault(); Camera.Enable(this); ResetMatrices(); // hook up events }
public ExampleWindow() : base(800, 600, GraphicsMode.Default, "") { // disable vsync VSync = VSyncMode.Off; // set up camera Camera = new Camera(); Camera.SetBehavior(new ThirdPersonBehavior()); Camera.DefaultState.Position.Z = 5; Camera.ResetToDefault(); Camera.Enable(this); ResetMatrices(); // hook up events Load += OnLoad; Unload += OnUnload; KeyDown += OnKeyDown; RenderFrame += OnRenderFrame; }