Microsoft DirectX 8.1 (Visual Basic)

D3DXMeshVertexBuffer8SetData

Copies vertices from a vertex array into a vertex buffer attached to a mesh object.

D3DXMeshVertexBuffer8SetData( _ 
    D3DXMeshobj As Unknown, _ 
    Offset As Long, _ 
    Size As Long, _ 
    Flags As Long, _ 
    Data As Any) As Long

Parameters

D3DXMeshobj
Object that resolves to a D3DXMesh object that contains the vertex buffer to set.
Offset
Offset, in bytes, from the start of the buffer to where data is set.
Size
Size of the buffer, in bytes.
Flags
A combination of one or more valid locking flags defined by the CONST_D3DLOCKFLAGS enumeration, describing the type of lock to perform.
Data
The first element of an array of vertices used to set the vertex buffer. See Remarks.

Return Values

If the function succeeds, the return value is D3D_OK.

If the function fails, the return value can be one of the following.

D3DERR_INVALIDCALL
E_INVALIDARG

Error Codes

Err.Number is not set for this function.

Remarks

The following code fragment demonstrates a typical use for this function.

Dim VertArray(9) As D3DVERTEX
Dim Mesh As D3DXMesh
Dim hr As Long

'The following code assumes that Mesh has been properly initialized
hr = D3DXMeshVertexBuffer8SetData(Mesh, 0, (Len(VertArray(0)) * 10), _ 
                                  0, VertArray(0))

See Also

D3DXMeshVertexBuffer8GetData