DDPIXELFORMAT

The DDPIXELFORMAT structure describes the pixel format of a DirectDrawSurface object for the IDirectDrawSurface3::GetPixelFormat method.

typedef struct _DDPIXELFORMAT{

DWORD dwSize;

DWORD dwFlags;

DWORD dwFourCC;

union

{

DWORD dwRGBBitCount;

DWORD dwYUVBitCount;

DWORD dwZBufferBitDepth;

DWORD dwAlphaBitDepth;

};

union

{

DWORD dwRBitMask;

DWORD dwYBitMask;

};

union

{

DWORD dwGBitMask;

DWORD dwUBitMask;

};

union

{

DWORD dwBBitMask;

DWORD dwVBitMask;

};

union

{

DWORD dwRGBAlphaBitMask;

DWORD dwYUVAlphaBitMask;

DWORD dwRGBZBitMask;

DWORD dwYUVZBitMask;

};

} DDPIXELFORMAT, FAR* LPDDPIXELFORMAT;

Members

dwSize

Size of the structure, in bytes. This member must be initialized before the structure is used.

dwFlags

Optional control flags.

DDPF_ALPHA
  The pixel format describes an alpha-only surface.
DDPF_ALPHAPIXELS
  The surface has alpha channel information in the pixel format.
DDPF_COMPRESSED
  The surface will accept pixel data in the specified format and compress it during the write operation.
DDPF_FOURCC
  The dwFourCC member is valid and contains a FOURCC code describing a non-RGB pixel format..
DDPF_PALETTEINDEXED1
DDPF_PALETTEINDEXED2
DDPF_PALETTEINDEXED4
DDPF_PALETTEINDEXED8
  The surface is 1-, 2-, 4-, or 8-bit color indexed.
DDPF_PALETTEINDEXEDTO8
  The surface is 1-, 2-, or 4-bit color indexed to an 8-bit palette.
DDPF_RGB
  The RGB data in the pixel format structure is valid.
DDPF_RGBTOYUV
  The surface will accept RGB data and translate it during the write operation to YUV data. The format of the data to be written will be contained in the pixel format structure. The DDPF_RGB flag will be set.
DDPF_YUV
  The YUV data in the pixel format structure is valid.
DDPF_ZBUFFER
  The pixel format describes a z-buffer-only surface.
DDPF_ZPIXELS
  The surface is in RGBZ format.

dwFourCC

FourCC code. For more information see, Four Character Codes (FOURCC).

dwRGBBitCount

RGB bits per pixel (4, 8, 16, 24, or 32).

dwYUVBitCount

YUV bits per pixel (4, 8, 16, 24, or 32)

dwZBufferBitDepth

Z-buffer bit depth (8, 16, or 24). 32-bit z-buffers are not supported.

dwAlphaBitDepth

Alpha channel bit depth (1, 2, 4, or 8).

dwRBitMask

Mask for red bits.

dwYBitMask

Mask for y bits.

dwGBitMask

Mask for green bits.

dwUBitMask

Mask for U bits.

dwBBitMask

Mask for blue bits.

dwVBitMask

Mask for V bits.

dwRGBAlphaBitMask and dwYUVAlphaBitMask

Masks for alpha channel.

dwRGBZBitMask and dwYUVZBitMask

Masks for z channel.

QuickInfo

  Windows NT: Use version 4.0 or later.
  Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in ddraw.h.