Platform SDK: DirectX

IDirectDrawSurface7::GetLOD

The IDirectDrawSurface7::GetLOD method retrieves the maximum level of detail currently set for a managed mipmap surface. This method succeeds only on managed textures (see Remarks).

HRESULT GetLOD(
    LPDWORD lpdwMaxLOD
);

Parameters

lpdwMaxLOD
Address of a variable to contain the maximum level-of-detail value if the call succeeds.

Return Values

If the method succeeds, the return value is DD_OK.

If it fails, the method can return 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, a value of 2 in the variable at lpdwMaxLOD indicates that the texture manager loads only 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, a value of 2 in lpdwMaxLOD means that the largest mipmap ever present in video memory has dimensions 64×64.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in ddraw.h.

See Also

IDirectDrawSurface7::SetLOD, Texture Filtering With Mipmaps, Automatic Texture Management, Textures