Fixed issue with incorrect delegate signature.

This commit is contained in:
2020-06-01 16:31:56 -05:00
parent e59e78e08c
commit 484dbbece3
11 changed files with 227 additions and 130 deletions

View File

@@ -1,13 +1,27 @@
using System;
using System.Drawing;
using SlatedGameToolkit.Framework.Graphics.Textures;
namespace SlatedGameToolkit.Framework.Graphics.Render
{
public class Renderer
public class Renderer : IDisposable
{
private Batch batch;
private Texture currentTexture;
public Renderer(Batch batch) {
this.batch = batch;
}
public Renderer() {
this.batch = new Batch();
}
public void Dispose()
{
batch.Dispose();
}
public void Queue(IRenderable renderable, Color color) {
if (renderable.Texture != currentTexture) {
if (batch.Batching) batch.End();
@@ -15,7 +29,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Render
currentTexture.Use();
batch.Begin(currentTexture);
}
batch.Draw(renderable, color);
batch.Add(renderable, color);
}
public void Render() {