Пример #1
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;
 }
Пример #2
0
        public GameWindow()
            : base(800, 600, GraphicsMode.Default, "")
        {
            _updateTimeSamples = new double[60];
            for (var i = _updateTimeSamples.Length - 1; i >= 0; i--) {
                _updateTimeSamples[i] = TargetUpdatePeriod;
            }
            // disable vsync
            VSync = VSyncMode.On;

            // set up camera
            Camera = new Camera();
            Camera.SetBehavior(new NullCameraBehaviour());
            Camera.ResetToDefault();
            Camera.Enable(this);
            ResetMatrices();
            // hook up events
            Load += OnLoad;
            Unload += OnUnload;
            RenderFrame += OnRenderFrame;
        }