Update terrain layer when the terrain data changes.

This commit is contained in:
Paul Chote
2014-12-21 11:38:15 +13:00
parent a48a878a71
commit 7df12cb3e9
4 changed files with 47 additions and 14 deletions

View File

@@ -34,10 +34,15 @@ namespace OpenRA.Renderer.Sdl2
}
public void SetData(T[] data, int length)
{
SetData(data, 0, length);
}
public void SetData(T[] data, int start, int length)
{
Bind();
GL.BufferSubData(BufferTarget.ArrayBuffer,
IntPtr.Zero,
new IntPtr(VertexSize * start),
new IntPtr(VertexSize * length),
data);
ErrorHandler.CheckGlError();