This topic is now archived and is closed to further replies.


Darkening the screen

Recommended Posts

I am using DirectDraw7 and I want to know how I could darken the screen. (Like at a pause screen) Using 256 colors I just modified the palette and went with it, but using 16bit color I am not sure how to go about this. I need to be able to do this both in exclusive mode and in window mode, but I can use two different routines if I need to. Any help, would be appritiated very much.

Share this post

Link to post
Share on other sites
Original post by Rob Lemmens
1> lock the surface
2> read in the first pixel
3> decrease its RGB Value
4> read the next pixel and loop till youre dun
5> unlock the surface

This, however, is VERY slow...
whenever possible, always avoid locking the surface, and when you have to lock the surface, do it for as little time possible.
A much more efficient (and faster) way to do this, is to set your ddgammaramps and just use a for-loop that adjusts the Gamma all the way down to 0 (then back up for a fade in).
since gammaramps dont lock the surface, its much much faster.. yet you''ll be limiting your speed to people with hardware support.
software gammaramps are just as slow as the lock/set/unlock method.

;another space monkey;

Share this post

Link to post
Share on other sites