Share via


IDirect3DMobileIndexBuffer::Lock (Windows CE 5.0)

Send Feedback

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

HRESULT Lock(  UINT OffsetToLock,  UINT SizeToLock,  BYTE** ppbData,  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.
  • ppbData
    [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 Values

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

OS Versions: Windows CE 5.0 and later.
Header: D3dm.h.
Link Library: D3dm.lib, D3dmguid.lib.

See Also

IDirect3DMobileIndexBuffer | D3DMLOCK Values | IDirect3DMobileDevice::DrawPrimitive

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.