public HardwareIndexBuffer( HardwareBufferManagerBase manager, IndexType type, int numIndices, BufferUsage usage, bool useSystemMemory, bool useShadowBuffer )
: base( usage, useSystemMemory, useShadowBuffer )
{
this.type = type;
this.numIndices = numIndices;
this.Manager = manager;
// calc the index buffer size
sizeInBytes = numIndices;
if ( type == IndexType.Size32 )
{
indexSize = Marshal.SizeOf( typeof( int ) );
}
else
{
indexSize = Marshal.SizeOf( typeof( short ) );
}
sizeInBytes *= indexSize;
// create a shadow buffer if required
if ( useShadowBuffer )
{
shadowBuffer = new DefaultHardwareIndexBuffer( Manager, type, numIndices, BufferUsage.Dynamic );
}
}