Fixed documentation on the event args for the Resize event.

Ensure that we call the base method when we override an On* method.
This commit is contained in:
the_fiddler 2009-10-14 18:25:51 +00:00
parent 34f36d579f
commit 3fbee6a156

View file

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