Jump to content
  • Advertisement

Archived

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

cpprulz

Fading with a palette

This topic is 5477 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

Is there a function I can call in DirectDraw to fade surfaces or the screen to black, white, or whatever while using palettes? I know about the gamma ramp functions for 16\32 bit color modes, but how about 8 bit color modes? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Why on earth are you using 8-bit color? If my DirectDraw memory serves correct, can''t you adjust your palette''s and just fade them to shades of grey?

Share this post


Link to post
Share on other sites
8-bit colors are more efficient... Everything generally loads faster and is in some ways easier to use.

Anyhow, it depends on how you want to fade it, I think you could just do it yourself, by adding/subtracting so much of a color gradually in a certain increment (divide the distance of the color from 255 or 0 by the number of frames you want it to take to fade) Then remember these increments in an array until you need to fade back... Or to just switch back, you could just store the whole palette in an array.

I've never done this before, it's just my idea of how you COULD do it... If you're looking more to fade for a glowing effect around a light or something, this might not work as quickly... but I never tested it.

[edited by - BlackTanuki on September 24, 2003 10:28:49 PM]

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!