Esempio n. 1
0
 /// <summary>Creates a 800x600 window with the specified title.</summary>
 public WorldWindow()
     : base(800, 600, GraphicsMode.Default, "World3D")
 {
     VSync      = VSyncMode.On;
     camera     = new AzElCamera();
     camControl = new AzElCameraControl(this, camera);
 }
Esempio n. 2
0
 public AzElCameraControl(GameWindow game, AzElCamera camera)
 {
     this.game                     = game;
     this.camera                   = camera;
     this.game.Mouse.Move         += new EventHandler <MouseMoveEventArgs>(Mouse_Move);
     this.game.Mouse.WheelChanged += new EventHandler <MouseWheelEventArgs>(Mouse_WheelChanged);
     this.game.Mouse.ButtonDown   += (o, e) => { if (e.Button == MouseButton.Left)
                                                 {
                                                     leftMouseDown = e.IsPressed;
                                                 }
     };
     this.game.Mouse.ButtonUp += (o, e) => { if (e.Button == MouseButton.Left)
                                             {
                                                 leftMouseDown = e.IsPressed;
                                             }
     };
     this.game.MouseLeave       += (o, e) => leftMouseDown = false;
     this.game.Keyboard.KeyDown += (o, e) => UpdateKeyState(e.Key, true);
     this.game.Keyboard.KeyUp   += (o, e) => UpdateKeyState(e.Key, false);
 }