Platform SDK: DirectX

Blitting Basics

[C++]

Two methods are available for copying images to a DirectDraw surface: IDirectDrawSurface7::Blt and IDirectDrawSurface7::BltFast. (A third method, IDirectDrawSurface7::BltBatch, is not implemented in this version of DirectX.) These methods are called on the destination surface and receive the source surface as a parameter. The destination and source surfaces can be one and the same, and you don't have to worry about overlap—DirectDraw takes care to preserve all source pixels before overwriting them.

Of the two implemented methods, Blt is the more flexible and BltFast is the faster—but only if there is no hardware blitter. You can determine the blitting capabilities of the hardware from the DDCAPS structure obtained in the lpDDDriverCaps parameter of the IDirectDraw7::GetCaps method. If the dwCaps member contains DDCAPS_BLT, the hardware has at least minimal blitting capabilities.

[Visual Basic]

Five methods are available for copying images to a DirectDraw surface: DirectDrawSurface7.Blt, DirectDrawSurface7.BltColorFill, DirectDrawSurface7.BltFast, DirectDrawSurface7.BltFx and DirectDrawSurface7.BltToDC. These methods are called on the destination surface and receive the source surface as a parameter. The destination and source surfaces can be one and the same, and you don't have to worry about overlap—DirectDraw takes care to preserve all source pixels before overwriting them.

Of the implemented methods, Blt is the more flexible and BltFast is the faster—but only if there is no hardware blitter. You can determine the blitting capabilities of the hardware from the DDCAPS type obtained in the hwCaps parameter of the DirectDraw7.GetCaps method. If the lCaps member contains DDCAPS_BLT, the hardware has at least minimal blitting capabilities.