Sign in to follow this  

images in DD have to match palettes?

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

This topic is 4736 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this