SrcTransBltBM

Copy a block of system memory to a location in video memory with Bus Mastering and source transparency.

Declaration

void NAPI GA_2DRenderFuncs::SrcTransBltBM(
    void *srcAddr,
    N_int32 srcPhysAddr,
    N_int32 srcPitch,
    N_int32 srcLeft,
    N_int32 srcTop,
    N_int32 width,
    N_int32 height,
    N_int32 dstLeft,
    N_int32 dstTop,
    N_int32 mix,
    GA_color transparent)

Prototype In

snap/graphics.h

Parameters

srcAddr

Address of source bitmap in system memory

srcPhysAddr

Physical address of source bitmap in system memory

srcPitch

Pitch of source bitmap in bytes

srcLeft

Left coordinate within source bitmap to copy

srcTop

Top coordinate within source bitmap to copy

width

Width of the rectangle in pixels

height

Height of the rectangle in scanlines

dstLeft

Left coordinate of destination

dstTop

Top coordinate of destination

mix

Mix code for the copy (GA_mixCodesType)

transparent

Transparent color value

 

Description

This routine will copy a bitmap from system memory with a physical starting address of srcPhysAddr to the destination rectangle (dstLeft, dstTop, dstLeft+width-1, dstTop+height-1) with the specified mix and with source transparency. The mix code will be used to combine the source bitmap data with the pixels in the destination bitmap. The transparent color passed will be used to mask out pixels in the source bitmap from being written to the destination area. Where a pixel in the source bitmap matches the transparent color, the pixel will not be written to the destination bitmap. The srcPhysAddr value points to the start of the bitmap data in system memory as a physical memory address, not a linear memory address that the application software normally deals with. It is up to the calling application to use the necessary OS services to allocate a block of contiguous physical memory for the bitmap data, and to obtain the physical memory address to be passed into this function.

This version is different to the SrcTransBltSys function in that the bitmap data is copied using Bus Mastering by the graphics accelerator, which allows this function to return before the copy has completed and the accelerator will complete the copy in the background with a DMA Bus Master operation. If this hardware supports Bus Mastering and this function is available, it will usually be the fastest method to copy a block of system memory to video memory.

Note that the srcLeft and srcTop coordinates define an offset within the source bitmap to be copied, so it will copy only a portion of the memory bitmap.

Note:    Although you can achieve the same effect of this routine using the generic BitBltFxBM function, this function is provided separately as it is usually a workhorse function for sprite based game applications and needs to be as efficient as possible.

See Also

SrcTransBlt, SrcTransBltLin, SrcTransBltSys, DstTransBlt, BitBlt, BitBltFx

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com