/// <summary> /// Respond to resize events here. /// </summary> /// <param name="e">Contains information on the new GameWindow size.</param> /// <remarks>There is no need to call the base implementation.</remarks> protected override void OnResize(EventArgs e) { GL.Viewport(0, 0, Width, Height); _projectionMatrix = Matrix4.CreateTranslation(new Vector3(-Width / 2.0f, -Height / 2.0f, 0)) * Matrix4.CreateScale(new Vector3(1, -1, 1)) * Matrix4.CreateOrthographic(Width, Height, -1.0f, 1.0f); renderer.Resize(ref _projectionMatrix, Width, Height); canvas.SetSize(Width, Height); }
/// <summary> /// Respond to resize events here. /// </summary> /// <param name="e">Contains information on the new GameWindow size.</param> /// <remarks>There is no need to call the base implementation.</remarks> protected override void OnResize(EventArgs e) { renderer.Resize (Width, Height); canvas.SetSize(Width, Height); }