Overview Members Chapter Previous Next

CDXScreen::FadeToSource

void FadeToSource( WORD duration ) ;

NAME: FadeToSource.

PURPOSE: Fades the screen to to the image found on the back buffer. This function works for all graphics modes except 8bpp modes. It uses software alpha blending to accomplish the fade therefore it should work on all graphics cards. It makes a temp copy of the back buffer then alpha blends different shades back to the back buffer then flips it to the front buffer. I would use it like this:

      Screen->GetBack()->Fill(BLACK);
      Screen->Flip();
       load image to back buffer   
      Screen->FadeToSource(1500);

INPUT: duration - the amount of time for the entire fade in milliseconds. Good values seem to be between 500-2000;

RETURNS: nothing.