Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
 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();
     }
 }
Exemplo n.º 3
0
 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
 }
Exemplo n.º 4
0
 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;
 }