Bink SDK 1.5v

# BinkBufferBlit

The function BinkBufferBlit copies the pixel data onto the screen (for the off-screen variety of BinkBuffers).

    void BinkBufferBlit(
      HBINKBUFFER bink_buf,
      BINKRECT_ARRAY rects,
      U32 num_rects
    );

#### In Parameters

bink_buf
  Specifies the BinkBuffer handle.
rects
  Specifies a pointer to an array of rectangular areas to copy.
num_rects
  Specifies the number rectangles pointed to by the rects parameter.

#### Discussion

This function blits the pixel data onto the screen for the off-screen style BinkBuffers. For overlay BinkBuffers, this function blits the color key pixels into your window (this allows the overlay to appear on the screen). For primary surface BinkBuffers, this function simply returns without doing anything. You will almost always call this function with the FrameRects field from the Bink structure after calling BinkGetRects. BinkGetRects fills the FrameRects field with the dirty rectangles from the most recently decompressed Bink frame. So, the blitting logic would look something like this:

`

    BinkDoFrame( bink );                // decompress a frame
    if ( BinkBufferLock( bink_buf ) ){  BinkCopyToBuffer( bink,                 // copy into the BinkBuffer                    bink_buf->Buffer,                    bink_buf->BufferPitch,                    bink_buf->Height,                    0,0,                    bink_buf->SurfaceType );    BinkBufferUnlock( bink_buf );}
    // blit the data onto the screenBinkBufferBlit( bink_buf,                bink->FrameRects,                BinkGetRects( bink, bink_buf->SurfaceType ) );

`

Note that you shouldn't call the BinkBufferBlit function while the buffer is locked - always call BinkBufferUnlock before calling BinkBufferBlit.

Group: BinkBuffer API
Related Functions: BinkBufferLock, BinkBufferOpen, BinkBufferUnlock, BinkGetRects
Related Basic Types: BINKBUFFER_OPEN_FLAGS, BINKRECT_ARRAY, HBINKBUFFER, U32, void

For technical support, e-mail Bink1@radgametools.com
© Copyright 1994-2003 RAD Game Tools, Inc. All Rights Reserved.