Blitting with BltFast

When using IDirectDrawSurface4::BltFast, you supply a valid rectangle in the source surface from which the pixels are to be copied (or NULL to specify the entire surface), and an x-coordinate and y-coordinate in the destination surface. The source rectangle must be able to fit in the destination surface with its top left corner at that point, or the call will fail with a return value of DDERR_INVALIDRECT. BltFast cannot be used on surfaces that have an attached clipper.

No stretching, mirroring, or other effects can be performed when using BltFast.

BltFast Example

The following example copies pixels from an offscreen surface, lpDDSOffOne, to the primary surface, lpDDSPrimary. The flags ensure that the operation will take place as soon as the blitter is free, and that transparent pixels in the source image will not be copied. (For more information on the meaning of these flags, see Blit Timing and Transparent Blitting .)

lpDDSPrimary->BltFast(
        100, 200,    // Upper left xy of destination
        lpDDSOffOne, // Source surface
        NULL,        // Source rectangle = entire surface
        DDBLTFAST_WAIT | DDBLTFAST_SRCCOLORKEY );