IndexBuffer Constructor (Type, Int32, Device, Usage, Pool)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Initializes a new instance of the IndexBuffer class.
Namespace: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)
Syntax
'Declaration
Public Sub New ( _
typeIndexType As Type, _
numberIndices As Integer, _
device As Device, _
usage As Usage, _
pool As Pool _
)
'Usage
Dim typeIndexType As Type
Dim numberIndices As Integer
Dim device As Device
Dim usage As Usage
Dim pool As Pool
Dim instance As New IndexBuffer(typeIndexType, _
numberIndices, device, usage, pool)
public IndexBuffer(
Type typeIndexType,
int numberIndices,
Device device,
Usage usage,
Pool pool
)
public:
IndexBuffer(
Type^ typeIndexType,
int numberIndices,
Device^ device,
Usage usage,
Pool pool
)
new :
typeIndexType:Type *
numberIndices:int *
device:Device *
usage:Usage *
pool:Pool -> IndexBuffer
Parameters
- typeIndexType
Type: System.Type
A Type that indicates the type of index data the buffer holds. This can be a value type or any type that contains only value types.
- numberIndices
Type: System.Int32
The maximum number of indices the buffer can hold.
- device
Type: Microsoft.WindowsMobile.DirectX.Direct3D.Device
The Device object to associate with the index buffer.
- usage
Type: Microsoft.WindowsMobile.DirectX.Direct3D.Usage
Usage can be 0, which indicates no usage value. However, if usage is desired, use a combination of one or more Usage flags. It is good practice to match the usage parameter with the behavior flags in the Device constructor.
- pool
Type: Microsoft.WindowsMobile.DirectX.Direct3D.Pool
A member of the Pool enumerated type that describes a valid memory class into which to place the resource.
Exceptions
Exception | Condition |
---|---|
InvalidCallException | The method call is invalid. For example, a method's parameter might contain an invalid value. |
OutOfMemoryException | Direct3D does not have enough display memory to perform the operation. |
Remarks
Index buffers are memory resources used to hold indices. They are similar to surfaces and vertex buffers. The use of index buffers enables Direct3D to avoid unnecessary data copying and to place the buffer in the optimal memory type for the expected usage.
To use an index buffer, do the following:
Create an index buffer.
Lock the index buffer, fill it with indices, and then unlock it.
Pass the index buffer it to the Indices property of a Device.
Set up the vertices and vertex shader.
Call the DrawIndexedPrimitives method on the Device to render.
The MaxVertexIndex of a Caps indicates the maximum value of an index that can be used in an index buffer.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Platforms
Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Compact Framework
Supported in: 3.5, 2.0