Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.ResourceManagerDiscardBytes

Invokes the resource manager to free memory.

object.ResourceManagerDiscardBytes( _ 
    NumberOfBytes As Long)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
NumberOfBytes
The number of target bytes to discard. If 0 (zero), then the resource manager should discard all bytes.

Error Codes

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.

Remarks

The resource manager frees up memory allocations until the number of target bytes is reached. The resource manager follows a least-recently-used (LRU) priority technique.

Note that the number of bytes freed are not guaranteed to be contiguous, so you might not be able to create a resource that takes the number of bytes specified in Bytes after calling this method.