General progress on getting OpenGL based rendering.

This commit is contained in:
2020-06-01 01:27:38 -05:00
parent 5e85eb5de1
commit e59e78e08c
40 changed files with 995 additions and 501 deletions

View File

@@ -0,0 +1,25 @@
using System.Drawing;
using SlatedGameToolkit.Framework.Graphics.Textures;
namespace SlatedGameToolkit.Framework.Graphics.Render
{
public class Renderer
{
private Batch batch;
private Texture currentTexture;
public void Queue(IRenderable renderable, Color color) {
if (renderable.Texture != currentTexture) {
if (batch.Batching) batch.End();
currentTexture = renderable.Texture;
currentTexture.Use();
batch.Begin(currentTexture);
}
batch.Draw(renderable, color);
}
public void Render() {
if (batch.Batching) batch.End();
}
}
}