Compartilhar via


IndexBuffer.Lock Method (Int32, Int32, LockFlags)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

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
)
member Lock : 
        offsetToLock:int * 
        sizeToLock:int * 
        flags:LockFlags -> GraphicsStream 

Parameters

  • offsetToLock
    Type: System.Int32
    Offset into the index data to lock, in bytes.
  • sizeToLock
    Type: System.Int32
    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

Type: Microsoft.WindowsMobile.DirectX.GraphicsStream
A GraphicsStream that represents the locked index buffer.

Exceptions

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

.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

Lock Overload

Microsoft.WindowsMobile.DirectX.Direct3D Namespace