Share via


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.

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:

  1. Create an index buffer.

  2. Lock the index buffer, fill it with indices, and then unlock it.

  3. Pass the index buffer it to the Indices property of a Device.

  4. Set up the vertices and vertex shader.

  5. 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

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

See Also

Reference

IndexBuffer Class

IndexBuffer Members

IndexBuffer Overload

Microsoft.WindowsMobile.DirectX.Direct3D Namespace