DirectX SDK |
The information in this section pertains only to applications written in C and C++. See DirectDraw Visual Basic Tutorials.
The sample in Tutorial 3 (DDEx3) shows one simple method of placing bitmaps into an off-screen buffer before they are blitted to the back buffer. The sample in this tutorial (DDEx4) uses the techniques described in the previous tutorials to load a background and a series of sprites into an off-screen surface. Then it uses the IDirectDrawSurface7::BltFast method to copy portions of the off-screen surface to the back buffer, thereby generating a simple bitmap animation.
The bitmap file that DDEx4 uses, All.bmp, contains the background and 60 iterations of a rotating red donut with a black background. The DDEx4 sample contains new functions that set the color key for the rotating donut sprites. Then, the sample copies the appropriate sprite to the back buffer from the off-screen surface.
The new functionality demonstrated in DDEx4 is shown in the following steps: