add convenience overload to BindVertexBuffers

pull/14/head
cosmonaut 2021-01-22 13:54:49 -08:00
parent e4f68ae1df
commit 94a260ebd1
1 changed files with 22 additions and 0 deletions

View File

@ -186,6 +186,28 @@ namespace MoonWorks.Graphics
); );
} }
public unsafe void BindVertexBuffers(
params Buffer[] buffers
) {
var bufferPtrs = stackalloc IntPtr[buffers.Length];
var offsets = stackalloc ulong[buffers.Length];
for (var i = 0; i < buffers.Length; i += 1)
{
bufferPtrs[i] = buffers[i].Handle;
offsets[i] = 0;
}
Refresh.Refresh_BindVertexBuffers(
Device.Handle,
Handle,
0,
(uint) buffers.Length,
(IntPtr) bufferPtrs,
(IntPtr) offsets
);
}
public void BindIndexBuffer( public void BindIndexBuffer(
Buffer indexBuffer, Buffer indexBuffer,
uint offset, uint offset,