refactor: removed parameters on triangle batch calls on TriangleBatcher for multi window support
This commit is contained in:
@@ -19,8 +19,11 @@ public class MonoGameTriangleBatch : Behaviour, ITriangleBatch, IFirstFrameUpdat
|
||||
private BasicEffect basicEffect = null!;
|
||||
private readonly RasterizerState rasterizerState = new() { CullMode = CullMode.None };
|
||||
|
||||
private ICamera camera = null!;
|
||||
|
||||
public void FirstActiveFrame()
|
||||
{
|
||||
camera = Universe.FindRequiredBehaviour<ICamera>();
|
||||
GraphicsDevice graphicsDevice = Universe.FindRequiredBehaviour<MonoGameWindowContainer>().Window.GraphicsDevice;
|
||||
this.graphicsDevice = graphicsDevice;
|
||||
basicEffect = new(graphicsDevice);
|
||||
@@ -47,8 +50,8 @@ public class MonoGameTriangleBatch : Behaviour, ITriangleBatch, IFirstFrameUpdat
|
||||
{
|
||||
Viewport viewport = graphicsDevice.Viewport;
|
||||
|
||||
this.view = (view ?? Matrix4x4.Identity).Transposed.ToXnaMatrix();
|
||||
this.projection = (projection ?? Matrix4x4.CreateOrthographicViewCentered(viewport.Width, viewport.Height)).Transposed.ToXnaMatrix();
|
||||
this.view = (view ?? camera.ViewMatrix).Transposed.ToXnaMatrix();
|
||||
this.projection = (projection ?? camera.ProjectionMatrix).Transposed.ToXnaMatrix();
|
||||
}
|
||||
|
||||
public void End() => Flush();
|
||||
|
||||
Reference in New Issue
Block a user