Tutorial 3: Blitting from an Off-Screen Surface
The sample in Tutorial 2 (DDEX2) takes a bitmap and puts it in the back buffer, and then it flips between the back buffer and the primary buffer. This is not a very realistic approach to displaying bitmaps. The sample in this tutorial (DDEX3) expands on the capabilities of DDEX2 by including two off-screen buffers in which the two bitmapsžone for the even screen and one for the odd screenžare stored. It uses the IDirectDrawSurface3::BltFast method to copy the contents of an off-screen surface to the back buffer, and then it flips the buffers and copies the next off-screen surface to the back buffer.
The new functionality demonstrated in DDEX3 is shown in the following steps:
ˇStep 1: Creating the Off-Screen Surfaces
ˇStep 2: Loading the Bitmaps to the Off-Screen Surfaces
ˇStep 3: Blitting the Off-Screen Surfaces to the Back Buffer