From 5a37b8bdfee93aee7747dfbba0140ac60ca4b336 Mon Sep 17 00:00:00 2001 From: gered Date: Tue, 27 Aug 2013 21:34:28 -0400 Subject: [PATCH] update IndexBuffer to also allow zero-size --- Blarg.GameFramework/Graphics/IndexBuffer.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Blarg.GameFramework/Graphics/IndexBuffer.cs b/Blarg.GameFramework/Graphics/IndexBuffer.cs index 0b14e6a..ea2b9af 100644 --- a/Blarg.GameFramework/Graphics/IndexBuffer.cs +++ b/Blarg.GameFramework/Graphics/IndexBuffer.cs @@ -152,8 +152,13 @@ namespace Blarg.GameFramework.Graphics if (!IsClientSide) SizeBufferObject(); - if (CurrentPosition >= NumElements) - CurrentPosition = NumElements - 1; + if (numIndices == 0) + CurrentPosition = 0; + else + { + if (CurrentPosition >= NumElements) + CurrentPosition = NumElements - 1; + } } public void Extend(int amount)