Camera now uses correct graphics device reference.

This commit is contained in:
Harrison Deng 2019-02-07 23:44:39 -06:00
parent 5ba5506b58
commit 751bdd72e8
2 changed files with 3 additions and 2 deletions

View File

@ -18,7 +18,8 @@ namespace RecrownedAthenaeum.Camera
/// <summary>
/// A 2D camera from the generic <see cref="Camera3D"/>.
/// </summary>
public Camera2D() : base()
/// <param name="graphicsDevice">The graphics device to use if not using the one in <see cref="Configuration"/>.</param>
public Camera2D(GraphicsDevice graphicsDevice = null) : base(graphicsDevice)
{
}

View File

@ -65,7 +65,7 @@ namespace RecrownedAthenaeum.Camera
lookAt = Vector3.Forward;
upDirection = Vector3.Up;
Center();
projectionMatrix = Matrix.CreateOrthographic(graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height, 0, 1);
projectionMatrix = Matrix.CreateOrthographic(this.graphicsDevice.Viewport.Width, this.graphicsDevice.Viewport.Height, 0, 1);
Apply();
}