Partager via


IDirect3DMobileIndexBuffer::Lock

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method locks a range of index data and obtains a pointer to the index buffer memory.

Syntax

HRESULT Lock(
  UINT OffsetToLock,
  UINT SizeToLock,
  void** ppvData,
  DWORD Flags
);

Parameters

  • OffsetToLock
    [in] Offset into the index data to lock, in bytes.
  • SizeToLock
    [in] Size of the index data to lock, in bytes.
  • ppvData
    [out] Address of a pointer to an array of BYTE values, filled with the returned index data.
  • Flags
    [in] A combination of one or more D3DMLOCK Values to describe the type of lock to perform. The following list shows the allowable flags.

    • D3DMLOCK_READONLY
    • D3DMLOCK_DISCARD
    • D3DMLOCK_NOOVERWRITE

Return Value

If the method succeeds, the return value is D3DM_OK (see D3DM Values).

If the method fails, the return value can be D3DMERR_INVALIDCALL (see D3DMERR Values).

Remarks

When working with index buffers, you can make multiple lock calls. However, you must ensure that the number of lock calls match the number of unlock calls. IDirect3DMobileDevice::DrawPrimitive calls will not succeed with any outstanding lock count on any currently set index buffer.

The D3DMLOCK_DISCARD and D3DMLOCK_NOOVERWRITE flags are valid only on buffers created with D3MDUSAGE_DYNAMIC.

Requirements

Header d3dm.h
Library D3dm.lib, D3dmguid.lib
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

IDirect3DMobileIndexBuffer
D3DMLOCK Values
IDirect3DMobileDevice::DrawPrimitive