Microsoft DirectX 8.1 (Visual Basic)

Direct3DResource8.SetPrivateData

Associates data with the resource that is intended for use by the application, not by Microsoft® Direct3D®. Data is passed by value, and multiple sets of data can be associated with a single resource.

object.SetPrivateData( _ 
    RefGuid As DXGUID, _ 
    Data As Any, _ 
    SizeOfData As Long, _ 
    Flags As Long)

Parts

object
Object expression that resolves to a Direct3DResource8 object.
RefGuid
A DXGUID type, the globally unique identifier that identifies the private data to set.
Data
A buffer that contains the data to be associated with the resource.
SizeOfData
Size of the buffer at Data, in bytes.
Flags
Value that describes the type of data being passed, or indicates to the application that the data should be invalidated when the resource changes. This parameter can be the value defined by the CONST_D3DSPDFLAGS enumeration, or 0. If no flags are specified, Direct3D allocates memory to hold the data within the buffer and copies the data into the new buffer. The buffer allocated by Direct3D is automatically freed, as appropriate.

Error Codes

If the method fails, an error is raised and Err.Number can be set to one of the following values.

D3DERR_INVALIDCALL
E_OUTOFMEMORY

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Applies To

This method applies to the following classes, which implement methods from Direct3DResource8.

Remarks

Direct3D does not manage the memory at Data. If this buffer was dynamically allocated, it is the caller's responsibility to free the memory.

See Also

Direct3DResource8.FreePrivateData, Direct3DResource8.GetPrivateData