Share via


CPixel::ComputeMipMapOffset method

The CPixel::ComputeMipMapOffset method determines the sublevel offset of a mipmap texture.

Syntax

static void  ComputeMipMapOffset(
   const D3DSURFACE_DESC *pDescTopLevel,
         UINT            iLevel,
         BYTE            *pBits,
   const RECT            *pRect,
         D3DLOCKED_RECT  *pLockedRectData
);

Parameters

pDescTopLevel Pointer to a D3DSURFACE_DESC structure that describes the top level of the mipmap texture.

iLevel Specifies the level of the mipmap texture where the offset is determined.

pBits Pointer to the beginning of the top level of the mipmap texture or NULL if the caller only requires the offset.

pRect Pointer to a RECT structure that describes the subrectangular region or NULL if the caller only requires the beginning of the sublevel.

pLockedRectData Pointer to a D3DLOCKED_RECT structure that receives the pointer or offset to the locked rectangular region.

Return value

None

Remarks

Given the surface description, the level of the mipmap texture, a pointer to the top level, and the subrectangle, CPixel::ComputeMipMapOffset returns a pointer or offset to the locked rectangular region in the pBits member of the D3DLOCKED_RECT structure at pLockedRectData.

For more information about D3DLOCKED_RECT, D3DSURFACE_DESC, and RECT, see the Microsoft DirectX SDK documentation.

Requirements

Target platform

Desktop

Header

Pixel.hpp (include Pixel.hpp)