MeshBatchRenderer is now more strict about state.
This commit is contained in:
parent
2a007cfb70
commit
e4da7901bd
@ -136,6 +136,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Render
|
||||
/// </summary>
|
||||
/// <param name="mesh">Draws the given mesh.</param>
|
||||
public virtual void Draw(IMesh mesh) {
|
||||
if (!Batching) throw new InvalidOperationException("This batch has not been begun.");
|
||||
IPositionInterpolable moveable = mesh as IPositionInterpolable;
|
||||
if (moveable != null) {
|
||||
moveable.InterpolatePosition(batchDelta);
|
||||
@ -188,11 +189,12 @@ namespace SlatedGameToolkit.Framework.Graphics.Render
|
||||
|
||||
public virtual void End() {
|
||||
if (!Batching) throw new InvalidOperationException("This batch was never started.");
|
||||
this.Batching = false;
|
||||
Flush();
|
||||
this.Batching = false;
|
||||
}
|
||||
|
||||
public virtual void Flush() {
|
||||
if (!Batching) throw new InvalidOperationException("This batch has not been begun.");
|
||||
if (offsetIndex == 0) return;
|
||||
if (texture != null) {
|
||||
GLContext.BindTexture(TextureTarget.Texture2D, texture.Handle);
|
||||
|
Loading…
Reference in New Issue
Block a user