本文整理匯總了C#中SharpDX.Direct3D9.Device.CreateVertexBuffer方法的典型用法代碼示例。如果您正苦於以下問題:C# Device.CreateVertexBuffer方法的具體用法?C# Device.CreateVertexBuffer怎麽用?C# Device.CreateVertexBuffer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SharpDX.Direct3D9.Device
的用法示例。
在下文中一共展示了Device.CreateVertexBuffer方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: VertexBuffer
/// <summary>
/// Initializes a new instance of the <see cref="SharpDX.Direct3D9.VertexBuffer" /> class.
/// </summary>
/// <param name="device">The device that will be used to create the buffer.</param>
/// <param name="sizeInBytes">Size of the buffer, in bytes.</param>
/// <param name="usage">The requested usage of the buffer.</param>
/// <param name="format">The vertex format of the vertices in the buffer. If set to <see cref="SharpDX.Direct3D9.VertexFormat" />.None, the buffer will be a non-FVF buffer.</param>
/// <param name="pool">The memory class into which the resource will be placed.</param>
/// <param name="sharedHandle">The variable that will receive the shared handle for this resource.</param>
/// <remarks>This method is only available in Direct3D9 Ex.</remarks>
/// <msdn-id>bb174364</msdn-id>
/// <unmanaged>HRESULT IDirect3DDevice9::CreateVertexBuffer([In] unsigned int Length,[In] D3DUSAGE Usage,[In] D3DFVF FVF,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVertexBuffer9** ppVertexBuffer,[In] void** pSharedHandle)</unmanaged>
/// <unmanaged-short>IDirect3DDevice9::CreateVertexBuffer</unmanaged-short>
public VertexBuffer(Device device, int sizeInBytes, Usage usage, VertexFormat format, Pool pool, ref IntPtr sharedHandle)
: base(IntPtr.Zero)
{
unsafe
{
sharedHandle = IntPtr.Zero;
fixed (void* pSharedHandle = &sharedHandle)
device.CreateVertexBuffer(sizeInBytes, usage, format, pool, this, new IntPtr(pSharedHandle));
}
}