Share via


IndexBuffer.Lock Method (Int32, LockFlags)

Locks a range of index data and obtains a pointer to the index buffer memory.

Namespace: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in microsoft.windowsmobile.directx.dll)

Syntax

'Declaration
Public Function Lock ( _
    offsetToLock As Integer, _
    flags As LockFlags _
) As Array
'Usage
Dim instance As IndexBuffer
Dim offsetToLock As Integer
Dim flags As LockFlags
Dim returnValue As Array

returnValue = instance.Lock(offsetToLock, flags)
public Array Lock (
    int offsetToLock,
    LockFlags flags
)
public:
Array^ Lock (
    int offsetToLock, 
    LockFlags flags
)
public Array Lock (
    int offsetToLock, 
    LockFlags flags
)
public function Lock (
    offsetToLock : int, 
    flags : LockFlags
) : Array
Not applicable.

Parameters

  • offsetToLock
    Offset into the index data to lock, in bytes.

Return Value

An Array that represents the locked index buffer.

Exceptions

Exception type Condition

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.

Remarks

A call to the DrawPrimitives method on a Device will succeed only if there is no outstanding lock count on any currently set index buffer.

The Discard and NoOverwrite fields for a LockFlags are valid only with buffers created with the Dynamic member of the Usage enumeration.

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Compact Framework

Supported in: 2.0

See Also

Reference

IndexBuffer Class
IndexBuffer Members
Microsoft.WindowsMobile.DirectX.Direct3D Namespace