Microsoft DirectX 8.1 (Visual Basic) |
Locks a range of vertex data and obtains access to the vertex buffer memory.
object.Lock( _ OffsetToLock As Long, _ SizeToLock As Long, _ Data As Long, _ Flags As Long)
If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
To lock, read, and unlock vertex data with a single function call, use D3DVertexBuffer8GetData.
To lock fill, and unlock vertex data with a single function call, use D3DVertexBuffer8SetData.
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. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set vertex buffer.
See Using Dynamic Vertex and Index Buffers for information on using D3DLOCK_DISCARD or D3DLOCK_NOOVERWRITE for the Flags parameter of the Lock method.
Direct3DVertexBuffer8.Unlock, D3DVertexBuffer8GetData, D3DVertexBuffer8SetData