Share via


CPixel::ComputeSurfaceOffset method

The CPixel::ComputeSurfaceOffset method determines the subrectangular offset of a surface.

Syntax

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

Parameters

pDescTopLevel Pointer to a D3DSURFACE_DESC structure that describes the surface.

pBits Pointer to the beginning of the surface 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 surface.

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, a pointer to the beginning of the surface, and the subrectangle, CPixel::ComputeSurfaceOffset 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)