Non-RGB surface formats are described by four-character codes (FOURCC codes). If an application calls the IDirectDrawSurface2::GetPixelFormat method to request the pixel format, and the surface is a non-RGB surface, the DDPF_FOURCC flag will be set and the dwFourCC member of the DDPIXELFORMAT structure will be valid. If the FOURCC code represents a YUV format, the DDPF_YUV flag will also be set and the dwYUVBitCount, dwYBits, dwUBits, dwVBits, and dwYUVAlphaBits members will be valid masks that can be used to extract information from the pixels.
If an RGB format is present, the DDPF_RGB flag will be set and the dwRGBBitCount, dwRBits, dwGBits, dwBBits, and dwRGBAlphaBits members will be valid masks that can be used to extract information from the pixels. The DDPF_RGB flag can be set in conjunction with the DDPF_FOURCC flag if a non-standard RGB format is being described.
During color and format conversion, two sets of FOURCC codes are exposed to the application. One set of FOURCC codes represents what the blitting hardware is capable of; the other represents what the overlay hardware is capable of.