Jump to content
  • Advertisement


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


Darkening the screen

This topic is 6210 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!