Share via


IndexBuffer.Lock Method (Int32, 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, _
    sizeToLock As Integer, _
    flags As LockFlags _
) As GraphicsStream
'Usage
Dim instance As IndexBuffer
Dim offsetToLock As Integer
Dim sizeToLock As Integer
Dim flags As LockFlags
Dim returnValue As GraphicsStream

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

Parameters

  • offsetToLock
    Offset into the index data to lock, in bytes.
  • sizeToLock
    Size of the index data to lock, in bytes. To lock the entire index buffer, specify 0 for the sizeToLock and offsetToLock parameters.

Return Value

A GraphicsStream 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