Scissoring now works and implemented; Refactoring as well;

This commit is contained in:
2019-03-27 02:35:20 -05:00
parent b045033b25
commit d7ca521b9b
17 changed files with 129 additions and 119 deletions

View File

@@ -1,6 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using RecrownedAthenaeum.Camera;
using System;
namespace RecrownedAthenaeum.Render
@@ -36,13 +35,17 @@ namespace RecrownedAthenaeum.Render
vertices = new VertexPositionColor[verticesPerBatch + 1];
this.graphicsDevice = graphicsDevice;
basicEffect = new BasicEffect(graphicsDevice);
basicEffect.VertexColorEnabled = true;
basicEffect.Projection = Matrix.CreateOrthographicOffCenter(0, graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height, 0, 0, 1);
basicEffect.World = Matrix.Identity;
basicEffect.View = Matrix.CreateLookAt(Vector3.Zero, Vector3.Forward, Vector3.Up);
}
/// <summary>
/// Starts the batch. Batch cannot be started twice.
/// </summary>
/// <param name="primitiveType">The type of primitive this batch would be drawing.</param>
/// <param name="effect">Effect to use to render the primitives. Default will use a <see cref="BasicEffect"/>.</param>
/// <param name="effect">Effect to use to render the primitives. Default will use a <see cref="BasicEffect"/> with parameters set up during creation.</param>
public void Begin(PrimitiveType primitiveType, Effect effect = null)
{
if (began) throw new InvalidOperationException("Begin is being called twice before being ended.");