Jump to content
  • Advertisement
Sign in to follow this  
kubicon

images in DD have to match palettes?

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

Working with DirectDraw 7, If I set the DirectDraw Palette to the palette of a bitmap, does every bitmap that I place on the primary or secondary surfaces have to match that pallete?

Share this post


Link to post
Share on other sites
Advertisement
If you have a paletted mode, *everything* on the screen shares that palette. In a paletted mode, every pixel is represented in memory by a certain number of bits. These bits form an index into the palette.

Share this post


Link to post
Share on other sites
In case you don't want to hassle with palettes, try 32-bit mode, or get brave and attempt 24-bit (not sure if it'll work).

Share this post


Link to post
Share on other sites
I'll try 32bits at some point. Right now I'm learning with the 8 and 16 bits. You know the book, "Tricks of windows game programming gurus, second edition". So far it's pretty good. I hope he talks about 32bits in there.

Which mode do you think is the easiest?

Share this post


Link to post
Share on other sites
Quote:
Original post by kubicon
Right now I'm learning with the 8 and 16 bits. You know the book, "Tricks of windows game programming gurus, second edition".

I'v got that book. I'm finding it to be a great resource.

Share this post


Link to post
Share on other sites
Well it depends... In my opinion, 8-bit seems easier, but not as good (of course).
The 8-bit format uses the pallette, with 256 possibilities. All you have to do is define your pallette, and remember what index of a certain color is. For example, RGB(255,255,0) is the 3rd color on your pallette. You'd have to remember that.
The 16-bit format is a little bit harder. It has 5-6-5 order (5 bits for Red, 6 bits for Green, and 5 bits for Blue) [reversed?]. In order to properly utilize it, you'd have to use the bit-wise operators and bit masks to calculate colors.
The truth is, I don't completely know. They have some articles here on DirectDraw, dealing with 16-bit graphics. I suggest looking at those.
Someone please tell me if I'm wrong.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!