Jump to content
  • Advertisement

Archived

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

eyesonly_d

Darkening the screen

This topic is 6123 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
Advertisement
quote:
Original post by Rob Lemmens
Just
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.


-eldee
;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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!