Microsoft DirectX 9.0 |
The BltFast method performs a source copy blit or transparent blit using a source or destination color key. BltFast always attempts to perform an asynchronous blit if the hardware supports this. It only works on video memory surfaces and cannot clip. The software implementation of BltFast is 10% faster than Blt. There is no speed difference if the video hardware is being used.
Normally, BltFast will return immediately with an error if the blitter is busy and the blit could not be set up. The DDBLTFAST_WAIT flag can be used to alter this behavior such that BltFast will wait until the blit can be set up, or another error occurs, before returning.
Syntax
HRESULT BltFast(
DWORD dwX,
DWORD dwY,
LPDIRECTDRAWSURFACE lpDDSrcSurface,
LPRECT lpSrcRect,
DWORD dwTrans
);
Parameters
dwX
X coordinate on destination surface to blit to.
dwY
Y coordinate on destination surface to blit to.
lpDDSrcSurface
Points to the IDirectDrawSurface interface of the source for the blit operation.
lpSrcRect
Points to a RECT structure that defines the upper left and lower right points of the rectangle on the source surface which is to be blted from.
dwTrans
Specify the type of transfer.
Value | Description |
DDBLTFAST_DESTCOLORKEY | Transparent blit using the destination's color key. |
DDBLTFAST_NOCOLORKEY | Normal copy blit -- no transparency. |
DDBLTFAST_SRCCOLORKEY | Transparent blit using the source's color key. |
DDBLTFAST_WAIT | Do not return immediately with the DDERR_WASSTILLDRAWING message if the bltter is busy -- wait until the Blt can be set up or another error occurs. |
Return Values
Value | Description |
DD_OK | The method succeeded. |
DDERR_INVALIDPARAMS | One or more of the input parameters is invalid. |
DDERR_SURFACELOST | Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface object representing this surface should have Restore called on it. |
DDERR_SURFACEBUSY | Access to this surface is being refused because the surface is already locked by another thread. |
DDERR_INVALIDOBJECT | DirectDraw received a pointer that was an invalid DirectDraw object. |
DDERR_INVALIDRECT | Rectangle provided was invalid. |
DDERR_EXCEPTION | An exception was encountered while performing the requested operation. |
DDERR_UNSUPPORTED | Action not supported. |
DDERR_GENERIC | Generic failure. |
DDERR_NOBLTHW | No blitter hardware present. |
See Also