DirectX SDK

IDirectDrawSurface7::BltFast

The IDirectDrawSurface7::BltFast method performs a source copy blit or transparent blit by using a source color key or destination color key.

HRESULT BltFast(
  DWORD dwX,                            
  DWORD dwY,                            
  LPDIRECTDRAWSURFACE7 lpDDSrcSurface,  
  LPRECT lpSrcRect,                     
  DWORD dwTrans                         
);

Parameters

dwX and dwY
The x- and y-coordinates to blit to on the destination surface.
lpDDSrcSurface
Address of an IDirectDrawSurface7 interface for the DirectDrawSurface object that is the source of the blit.
lpSrcRect
Address of a RECT structure that defines the upper-left and lower-right corners of the rectangle to blit from on the source surface.
dwTrans
Type of transfer. The following transfers are defined:
DDBLTFAST_DESTCOLORKEY
A transparent blit that uses the destination color key.
DDBLTFAST_NOCOLORKEY
A normal copy blit with no transparency.
DDBLTFAST_SRCCOLORKEY
A transparent blit that uses the source color key.
DDBLTFAST_WAIT
Postpones the DDERR_WASSTILLDRAWING message if the blitter is busy, and returns as soon as the blit can be set up or another error occurs.

Return Values

If the method succeeds, the return value is DD_OK.

If it fails, the method can return one of the following error values:

DDERR_EXCEPTION
DDERR_GENERIC
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_INVALIDRECT
DDERR_NOBLTHW
DDERR_SURFACEBUSY
DDERR_SURFACELOST
DDERR_UNSUPPORTED
DDERR_WASSTILLDRAWING

Remarks

This method always attempts an asynchronous blit if it is supported by the hardware.

This method works only on display memory surfaces and cannot clip when blitting. If you use this method on a surface with an attached clipper, the call fails, and the method returns DDERR_UNSUPPORTED.

The software implementation of IDirectDrawSurface7::BltFast is 10 percent faster than the IDirectDrawSurface7::Blt method. However, there is no speed difference between the two if display hardware is used.

Typically, IDirectDrawSurface7::BltFast returns immediately with an error if the blitter is busy and the blit cannot be set up. You can use the DDBLTFAST_WAIT flag, however, if you want this method not to return until either the blit can be set up or another error occurs.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in ddraw.h.