/// <summary> /// Initializes a new instance of the <see cref="IndexBuffer"/> class. /// </summary> /// <param name="device">The device.</param> /// <param name="sizeInBytes">The size in bytes.</param> /// <param name="usage">The usage.</param> /// <param name="pool">The pool.</param> /// <param name="sixteenBit">if set to <c>true</c> use 16bit index buffer, otherwise, use 32bit index buffer.</param> /// <param name="sharedHandle">The shared handle.</param> /// <msdn-id>bb174357</msdn-id> /// <unmanaged>HRESULT IDirect3DDevice9::CreateIndexBuffer([In] unsigned int Length,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DIndexBuffer9** ppIndexBuffer,[In] void** pSharedHandle)</unmanaged> /// <unmanaged-short>IDirect3DDevice9::CreateIndexBuffer</unmanaged-short> public IndexBuffer(Device device, int sizeInBytes, Usage usage, Pool pool, bool sixteenBit, ref IntPtr sharedHandle) : base(IntPtr.Zero) { unsafe { fixed (void* pSharedHandle = &sharedHandle) device.CreateIndexBuffer(sizeInBytes, (int)usage, sixteenBit ? Format.Index16 : Format.Index32, pool, this, (IntPtr)pSharedHandle); } }
/// <summary> /// Initializes a new instance of the <see cref="IndexBuffer"/> class. /// </summary> /// <param name="device">The device.</param> /// <param name="sizeInBytes">The size in bytes.</param> /// <param name="usage">The usage.</param> /// <param name="pool">The pool.</param> /// <param name="sixteenBit">if set to <c>true</c> use 16bit index buffer, otherwise, use 32bit index buffer.</param> /// <param name="sharedHandle">The shared handle.</param> /// <msdn-id>bb174357</msdn-id> /// <unmanaged>HRESULT IDirect3DDevice9::CreateIndexBuffer([In] unsigned int Length,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DIndexBuffer9** ppIndexBuffer,[In] void** pSharedHandle)</unmanaged> /// <unmanaged-short>IDirect3DDevice9::CreateIndexBuffer</unmanaged-short> public IndexBuffer(Device device, int sizeInBytes, Usage usage, Pool pool, bool sixteenBit, ref IntPtr sharedHandle) : base(IntPtr.Zero) { unsafe { fixed(void *pSharedHandle = &sharedHandle) device.CreateIndexBuffer(sizeInBytes, (int)usage, sixteenBit ? Format.Index16 : Format.Index32, pool, this, (IntPtr)pSharedHandle); } }
/// <summary> /// Initializes a new instance of the <see cref="IndexBuffer"/> class. /// </summary> /// <param name="device">The device.</param> /// <param name="sizeInBytes">The size in bytes.</param> /// <param name="usage">The usage.</param> /// <param name="pool">The pool.</param> /// <param name="sixteenBit">if set to <c>true</c> use 16bit index buffer, otherwise, use 32bit index buffer.</param> /// <msdn-id>bb174357</msdn-id> /// <unmanaged>HRESULT IDirect3DDevice9::CreateIndexBuffer([In] unsigned int Length,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DIndexBuffer9** ppIndexBuffer,[In] void** pSharedHandle)</unmanaged> /// <unmanaged-short>IDirect3DDevice9::CreateIndexBuffer</unmanaged-short> public IndexBuffer(Device device, int sizeInBytes, Usage usage, Pool pool, bool sixteenBit) : base(IntPtr.Zero) { device.CreateIndexBuffer(sizeInBytes, (int)usage, sixteenBit ? Format.Index16 : Format.Index32, pool, this, IntPtr.Zero); }