chore: bumped dotnet version to 10
This commit is contained in:
@@ -8,12 +8,14 @@ namespace Engine.Integration.MonoGame;
|
||||
public class TriangleBatch : ITriangleBatch
|
||||
{
|
||||
private readonly GraphicsDevice graphicsDevice;
|
||||
private VertexBuffer vertexBuffer = default!;
|
||||
private readonly VertexBuffer vertexBuffer = default!;
|
||||
private readonly VertexPositionColor[] vertices = new VertexPositionColor[1024];
|
||||
|
||||
private int verticesIndex = 0;
|
||||
private Matrix _view;
|
||||
private Matrix _projection;
|
||||
private readonly BasicEffect basicEffect;
|
||||
private Matrix view = Matrix.Identity;
|
||||
private Matrix projection = Matrix.Identity;
|
||||
|
||||
private readonly BasicEffect basicEffect = null!;
|
||||
private readonly RasterizerState rasterizerState = new() { CullMode = CullMode.None };
|
||||
|
||||
public TriangleBatch(GraphicsDevice graphicsDevice)
|
||||
@@ -42,16 +44,16 @@ public class TriangleBatch : ITriangleBatch
|
||||
public void Begin(Matrix? view = null, Matrix? projection = null)
|
||||
{
|
||||
if (view != null)
|
||||
_view = view.Value;
|
||||
this.view = view.Value;
|
||||
else
|
||||
_view = Matrix.Identity;
|
||||
this.view = Matrix.Identity;
|
||||
|
||||
if (projection != null)
|
||||
_projection = projection.Value;
|
||||
this.projection = projection.Value;
|
||||
else
|
||||
{
|
||||
Viewport viewport = graphicsDevice.Viewport;
|
||||
_projection = Matrix.CreateOrthographicOffCenter(viewport.X, viewport.Width, viewport.Height, viewport.Y, 0, 1);
|
||||
this.projection = Matrix.CreateOrthographicOffCenter(viewport.X, viewport.Width, viewport.Height, viewport.Y, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,8 +65,8 @@ public class TriangleBatch : ITriangleBatch
|
||||
return;
|
||||
|
||||
graphicsDevice.RasterizerState = rasterizerState;
|
||||
basicEffect.Projection = _projection;
|
||||
basicEffect.View = _view;
|
||||
basicEffect.Projection = projection;
|
||||
basicEffect.View = view;
|
||||
vertexBuffer.SetData(vertices);
|
||||
|
||||
graphicsDevice.SetVertexBuffer(vertexBuffer);
|
||||
|
||||
Reference in New Issue
Block a user