ID3DXMesh::LockAttributeBuffer
Locks an attribute buffer and obtains a pointer to the attribute buffer memory.
HRESULT LockAttributeBuffer(
DWORD Flags,
DWORD** ppData
);
Parameters
- Flags
- [in] A combination of one or more locking flags, indicating how the attribute buffer memory should be locked.
- D3DLOCK_DISCARD
- The application overwrites, with a write-only operation, every location within the region being locked. This enables resources stored in non-native formats to save the decompression step.
- D3DLOCK_NOOVERWRITE
- Indicates that no information referred to in drawing calls since the start of the frame or the last lock without this flag will be modified during the lock. This can enable optimizations when the application is only appending data to the vertex buffer.
- D3DLOCK_NOSYSLOCK
- The default behavior of a video memory lock is to reserve a system-wide critical section, guaranteeing that no display mode changes will occur for the duration of the lock. This flag causes the system-wide critical section not to be held for the duration of the lock.
The lock operation is slightly more expensive, but it can enable the system to perform other duties, such as moving the mouse cursor. This flag is useful for long duration locks, such as the lock of the back buffer for software rendering that would otherwise adversely affect system responsiveness.
- D3DLOCK_READONLY
- The application will not write to the buffer. This enables resources stored in non-native formats to save the recompression step when unlocking.
- ppData
- [out, retval] Address of a pointer to an array of DWORD values, filled with the returned attribute buffer data.
Return Values
If the method succeeds, the return value is D3D_OK.
If the method fails, the return value can be D3DERR_INVALIDCALL.
Requirements
Header: Declared in D3dx8mesh.h.
Import Library: Use D3dx8.lib.
See Also
ID3DXMesh::UnlockAttributeBuffer, D3DXATTRIBUTERANGE