GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


DisplayBitmap by jnighthawk
void cBuffer::DisplayBitmap(int iBitmapID, int iXLoc, int iYLoc, bool bSwap)
{
    // Select the bitmap handle into the extra hdc that holds the bitmap
    hOldBitmap2 = (HBITMAP)SelectObject(hdcBitmap, Bitmaps[iBitmapID].hBitmap);

    // Blit the bitmap hdc into the backbuffer
    BitBlt(hdcBack, iXLoc, iYLoc, scrnRect.right, scrnRect.bottom,  hdcBitmap, 0, 0, SRCCOPY);

    // Select the old handle to the bitmap back where it was to clean up
    SelectObject(hdcBitmap, hOldBitmap2);
    if(bSwap)
        SwapBackBuffer(false);
}