Microsoft DirectX 8.1 (Visual Basic)

D3DXBaseMesh.LockIndexBuffer

Locks an index buffer and obtains access to the index buffer memory.

object.LockIndexBuffer( _ 
    Flags As Long) As Long

Parts

object
Object expression that resolves to a D3DXBaseMesh object.
Flags
Combination of one or more valid locking flags defined by the CONST_D3DLOCKFLAGS enumeration, describing how the index buffer memory should be locked.

Return Values

Returns a Long value providing access to the locked index data.

Error Codes

If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Applies To

This method applies to the following classes, which implement methods from D3DXBaseMesh.

Remarks

When working with index buffers, you are allowed to make multiple lock calls. However, you must ensure that the number of lock calls matches the number of unlock calls. DrawPrimitive calls do not succeed with any outstanding lock count on any currently set index buffer.

See Also

D3DXBaseMesh.UnlockIndexBuffer