Jump to content
  • Advertisement
Sign in to follow this  
jostpuur

tutorials for SDL palette stuff?

This topic is 3681 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 already know how to do graphics with SDL+GL, or with SDL and depth=24 mode without GL, but now I want to do something lighter where GL would be waste of power, and unfortunately running depth=24 graphics without GL gets quite heavy. So I would like to do depth=8 graphics with palette, but all the tutorials I've seen so far only explain how to do a quick start with depth=24. Anyone knowing a tutorial that explains how to do depth=8 graphics with SDL? [Edited by - jostpuur on July 19, 2008 5:41:57 AM]

Share this post


Link to post
Share on other sites
Advertisement
Oops. It seems I was a little bit messed with these depths. I should have been talking about depth=24, and not 16. 24 is the one where you have 8+8+8 bits for each pixel, 8 bits for each color RGB.

(Edit: I just discovered the edit button)

Share this post


Link to post
Share on other sites
hmhm... it could I was looking for wrong kind of info. I managed to take a closer look at the SDL documents. It seems the function SDL_MapRGB will enable the use of some default palette, and then there's no more need to deal with palettes manually. It could be I can manage on my own from this point.

Share this post


Link to post
Share on other sites
A while back I was only able to get SDL to work with 8 bit pallets correctly when in full screen mode. This was most likely due to user error however I found that the work it took to use pallets was not worth it in the end. In the end performance was much greater with 16 or 32 bit opengl since most of the work was done on the video card instead of CPU.

Share this post


Link to post
Share on other sites
Depth=24 is rare. Depth=8 is extremely rare Depth=32 is much more common and does more with the alpha-blending features if you choose to use them. If you don't choose to use them, the extra pad byte still helps with better alignment for pixel writes.

Emulating an 8-bit palette is best implemented in OpenGL using a fragment shader (I think).

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!