51 public void SetData<T>(T[] source,
int sourceStartIndex,
int sourceCount,
int targetStartIndex = 0) where T : unmanaged {
52 VerifyParametersSetData(source, sourceStartIndex, sourceCount, targetStartIndex);
53 GCHandle gCHandle = GCHandle.Alloc(source, GCHandleType.Pinned);
58 DataBox dataBox =
new(gCHandle.AddrOfPinnedObject() + sourceStartIndex * num, 1, 0);
59 ResourceRegion resourceRegion =
new(targetStartIndex * size, 0, 0, targetStartIndex * size + sourceCount * num, 1, 1);
65 BufferTargetARB.ElementArrayBuffer,
66 new IntPtr(targetStartIndex * size),
67 new UIntPtr((uint)(num * sourceCount)),
68 (gCHandle.AddrOfPinnedObject() + sourceStartIndex * num).ToPointer()
88 m_buffer =
new SharpDX.Direct3D11.Buffer(
91 ResourceUsage.Default,
92 BindFlags.IndexBuffer,
94 ResourceOptionFlags.None,
103 BufferTargetARB.ElementArrayBuffer,
106 BufferUsageARB.StaticDraw