Began trying to fix primitive batch. Added a default camera to the configuration.

This commit is contained in:
2019-01-30 07:46:58 -06:00
parent 8387cbc604
commit e1e2bbb3d7
13 changed files with 68 additions and 40 deletions

View File

@@ -24,7 +24,7 @@ namespace RecrownedAthenaeum.Camera
/// </summary>
public Matrix Matrix { get; private set; }
private GraphicsDevice graphicsDevice = Configuration.graphicsDeviceManager.GraphicsDevice;
private GraphicsDevice graphicsDevice;
/// <summary>
/// Constructs 2D camera.
@@ -32,8 +32,7 @@ namespace RecrownedAthenaeum.Camera
/// <param name="graphicsDevice">The graphics device to use. Will use graphics device from <see cref="Configuration"/>'s graphics device manager if this is null which it is by default.</param>
public Camera2D(GraphicsDevice graphicsDevice = null)
{
if (graphicsDevice != null) this.graphicsDevice = graphicsDevice;
if (this.graphicsDevice == null) throw new ArgumentNullException("Graphics device can't be null in setup and argument. One must not be null for use.");
this.graphicsDevice = graphicsDevice ?? (Configuration.GraphicsDeviceManager.GraphicsDevice);
Zoom = 1f;
Position.X = this.graphicsDevice.Viewport.Width * 0.5f;