Lots of progress on rendering textures.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Numerics;
|
||||
using SlatedGameToolkit.Framework.Exceptions;
|
||||
using SlatedGameToolkit.Framework.Graphics.Programs;
|
||||
using SlatedGameToolkit.Framework.Graphics.Textures;
|
||||
|
||||
namespace SlatedGameToolkit.Framework.Graphics.Render
|
||||
@@ -13,8 +16,8 @@ namespace SlatedGameToolkit.Framework.Graphics.Render
|
||||
this.batch = batch;
|
||||
}
|
||||
|
||||
public Renderer() {
|
||||
this.batch = new Batch();
|
||||
public Renderer(Camera camera, GLShaderProgram program, uint BatchVertexSize = 4096) {
|
||||
this.batch = new Batch(camera, program, BatchVertexSize);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
@@ -22,14 +25,13 @@ namespace SlatedGameToolkit.Framework.Graphics.Render
|
||||
batch.Dispose();
|
||||
}
|
||||
|
||||
public void Queue(IRenderable renderable, Color color) {
|
||||
public void Queue(IRenderable renderable, Matrix4x4 modelsMatrix) {
|
||||
if (renderable.Texture != currentTexture) {
|
||||
if (batch.Batching) batch.End();
|
||||
currentTexture = renderable.Texture;
|
||||
currentTexture.Use();
|
||||
batch.Begin(currentTexture);
|
||||
batch.Begin(currentTexture, modelsMatrix);
|
||||
}
|
||||
batch.Add(renderable, color);
|
||||
batch.Add(renderable, renderable.Color);
|
||||
}
|
||||
|
||||
public void Render() {
|
||||
|
||||
Reference in New Issue
Block a user