Microsoft DirectX 8.1 (Visual Basic) |
Locks a range of index data and obtains access to the index 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 index data with a single function call, use D3DIndexBuffer8GetData.
To lock, fill, and unlock index data with a single function call, use D3DIndexBuffer8SetData.
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. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set index 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.
Direct3DIndexBuffer8.Unlock, D3DIndexBuffer8GetData, D3DIndexBuffer8SetData