diff --git a/Source/QuickStart/Game.cs b/Source/QuickStart/Game.cs index 145be882..b21f4f46 100644 --- a/Source/QuickStart/Game.cs +++ b/Source/QuickStart/Game.cs @@ -23,6 +23,8 @@ namespace StarterKit /// Not used. public override void OnLoad(EventArgs e) { + base.OnLoad(e); + GL.ClearColor(System.Drawing.Color.MidnightBlue); GL.Enable(EnableCap.DepthTest); } @@ -32,9 +34,11 @@ namespace StarterKit /// a good place to set up your projection matrix (which probably changes /// along when the aspect ratio of your window). /// - /// Contains information on the new Width and Size of the GameWindow. + /// Not used. protected override void OnResize(EventArgs e) { + base.OnResize(e); + GL.Viewport(ClientRectangle); Matrix4 projection = Matrix4.CreatePerspectiveFieldOfView((float)Math.PI / 4, Width / (float)Height, 1.0f, 64.0f); @@ -48,6 +52,8 @@ namespace StarterKit /// Contains timing information for framerate independent logic. protected override void OnUpdateFrame(FrameEventArgs e) { + base.OnUpdateFrame(e); + if (Keyboard[Key.Escape]) Exit(); } @@ -58,6 +64,8 @@ namespace StarterKit /// Contains timing information. protected override void OnRenderFrame(FrameEventArgs e) { + base.OnRenderFrame(e); + GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); Matrix4 modelview = Matrix4.LookAt(Vector3.Zero, Vector3.UnitZ, Vector3.UnitY);