Partager via


IDirect3DMobileVertexBuffer::Lock (Windows CE 5.0)

Send Feedback

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

HRESULT Lock(  UINT OffsetToLock,  UINT SizeToLock,  BYTE** ppbData,  DWORD Flags);

Parameters

  • OffsetToLock
    [in] Offset into the vertex data to lock, in bytes.
  • SizeToLock
    [in] Size of the vertex data to lock, in bytes. Specify 0 to lock the entire vertex buffer.
  • ppbData
    [out] Address of a pointer to an array of BYTE values that is filled with the returned vertex 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 vertex buffers, you can make multiple lock calls; however, you must ensure that the number of lock calls match the number of unlock calls. If there is an outstanding lock count on any currently set vertex buffer, then IDirect3DMobileDevice::DrawPrimitive calls will not succeed.

The D3DMLOCK_DISCARD and D3DMLOCK_NOOVERWRITE flags (see D3DMLOCK Values) are valid only on buffers created with D3MDUSAGE_DYNAMIC (see D3DMUSAGE Values).

Requirements

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

See Also

IDirect3DMobileVertexBuffer | D3DMLOCK Values | IDirect3DMobileDevice::DrawPrimitive | D3DMUSAGE Values

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.