DirectX SDK

DirectDrawSurface7.SetLOD

The DirectDrawSurface7.SetLOD method sets the maximum level of detail for a managed mipmap surface. This method succeeds only on managed textures (see Remarks).

object.SetLOD(lod As Long)

Parameters

object
Object expression that resolves to a DirectDrawSurface7 object.
lod
Maximum level-of-detail value to be set for the mipmap chain if the call succeeds.

Return Values

If the method succeeds, it return DD_OK.

Error Codes

If the method fails, it raises an error, and Err.Number can be set to one of the following values:

DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS

Remarks

Applications can call this method only for managed textures (those that were created with the DDSCAPS2_TEXTUREMANAGE flag). Calling this method on a nonmanaged texture causes the method to fail and return DDERR_INVALIDOBJECT

This method communicates to the Direct3D texture manager the most detailed mipmap in this chain that it should load into local video memory. For example, in a five-level mipmap chain, setting lod to 2 indicates that the texture manager should only load mipmap levels 2 through 4 into local video memory at any given time. Likewise, if the most detailed mipmap in the chain has the dimensions 256×256, setting the maximum level to 2 means that the largest mipmap ever present in video memory has dimensions 64×64.

See Also

DirectDrawSurface7.GetLOD, Texture Filtering With Mipmaps, Automatic Texture Management , Textures