Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.GetAvailableTextureMem

Returns an estimate of the amount of available texture memory.

object.GetAvailableTextureMem( _ 
    Pool As CONST_D3DPOOL) As Long

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
Pool
CONST_D3DPOOL type, specifying the pool type to check.

Return Values

The function returns an estimate of the available texture memory.

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 returned value is rounded to the nearest megabyte (MB). This is done to reflect the fact that video memory estimates are never precise due to alignment and other issues that affect consumption by certain resources. Applications can use this value to make gross estimates of memory availability to make large-scale resource decisions such as how many levels of a mipmap to attempt to allocate. However, applications cannot use this value to make small-scale decisions such as if there is enough memory left to allocate another resource.