public override HardwareIndexBuffer CreateIndexBuffer(IndexType type, int numIndices, BufferUsage usage, bool useShadowBuffer) { Contract.Requires(numIndices > 0); #if AXIOM_D3D_MANAGE_BUFFERS // Override shadow buffer setting; managed buffers are automatically // backed by system memory if (useShadowBuffer) { useShadowBuffer = false; // Also drop any WRITE_ONLY so we can read direct if (usage == BufferUsage.DynamicWriteOnly) { usage = BufferUsage.Dynamic; } else if (usage == BufferUsage.StaticWriteOnly) { usage = BufferUsage.Static; } } #endif var idxBuf = new D3D9HardwareIndexBuffer(this, type, numIndices, usage, false, useShadowBuffer); lock ( IndexBuffersMutex ) { indexBuffers.Add(idxBuf); } return(idxBuf); }
public override HardwareIndexBuffer CreateIndexBuffer( IndexType type, int numIndices, BufferUsage usage, bool useShadowBuffer ) { Contract.Requires( numIndices > 0 ); #if AXIOM_D3D_MANAGE_BUFFERS // Override shadow buffer setting; managed buffers are automatically // backed by system memory if ( useShadowBuffer ) { useShadowBuffer = false; // Also drop any WRITE_ONLY so we can read direct if ( usage == BufferUsage.DynamicWriteOnly ) { usage = BufferUsage.Dynamic; } else if ( usage == BufferUsage.StaticWriteOnly ) { usage = BufferUsage.Static; } } #endif var idxBuf = new D3D9HardwareIndexBuffer( this, type, numIndices, usage, false, useShadowBuffer ); lock ( IndexBuffersMutex ) { indexBuffers.Add( idxBuf ); } return idxBuf; }