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:
parent
34f36d579f
commit
3fbee6a156
1 changed files with 9 additions and 1 deletions
|
@ -23,6 +23,8 @@ namespace StarterKit
|
|||
/// <param name="e">Not used.</param>
|
||||
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).
|
||||
/// </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)
|
||||
{
|
||||
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
|
|||
/// <param name="e">Contains timing information for framerate independent logic.</param>
|
||||
protected override void OnUpdateFrame(FrameEventArgs e)
|
||||
{
|
||||
base.OnUpdateFrame(e);
|
||||
|
||||
if (Keyboard[Key.Escape])
|
||||
Exit();
|
||||
}
|
||||
|
@ -58,6 +64,8 @@ namespace StarterKit
|
|||
/// <param name="e">Contains timing information.</param>
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue