Advertisement

fade to black

Started by February 05, 2005 08:37 PM
2 comments, last by CJM 19 years, 7 months ago
Hello. I'm using SDL and Dev C++ and i wanted to know if someone knew how to possibly fade a screen to black(or another color)?
It's definately possible since you can control individual pixels, but I can't say off the top of my head how to do it.

Check out this tutorial (if you haven't already seen it) for pixel manipulation:
http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/tut1
Advertisement
I haven't seen it. I'll take a look, thanks. ^_^.
Heya,

If you've got alphablending on your surface, why not just draw a rectangle over the entire screen area with RGBA of 0,0,0,n where n increases based on time from 0 to 255...

[Edit] on checking sdl's documentation, you can't actually alphablend using SDL_FillRect because it copies over the alpha information rather than blending it...

Maybe you could create a new surface that's the size of your window, or a portion of the size of your window, use FillRect to draw to that, and then blit the surface over your window.[/edit]

CJM

This topic is closed to new replies.

Advertisement