Indexed color still around for SDL2?

I was trying to play around with indexed color with SDL2. I’m running Linux
Mint 14 64 bit and I compiled SDL2 and SDL2_image myself and installed
them. I can link to them correctly and everything.

I haven’t done anything but RGB color in SDL 1.2. Poking around the SDL2
wiki, there seems to be indexed color stuff in there, for instance
"SDL_PIXELFORMAT_INDEX8" and some palette functions for SDL_Surface. There
doesn’t seem to be anything dealing with palettes for SDL_Texture objects.

I know the entire world has since moved to a true color world including
Allegro which I’ve also played with. So are palettes and indexed color even
a real option in SDL2?

If so, I don’t know how to begin. Creating a window and renderer don’t
appear to give me a bits per pixel option. Would it be essentially the same
if I looked for a SDL 1.2 guide on it?

SDL 2.0 mostly just has support for palettes in SDL_Surface, but not
textures. It will automatically convert paletted surfaces to truecolor
when uploading them to textures.

There are some neat tricks you can do with single channel textures and
shaders, but they’re outside the scope of the SDL 2D API, and you should
use OpenGL directly for those.On Fri, May 10, 2013 at 6:50 PM, Joshua Brown wrote:

I was trying to play around with indexed color with SDL2. I’m running
Linux Mint 14 64 bit and I compiled SDL2 and SDL2_image myself and
installed them. I can link to them correctly and everything.

I haven’t done anything but RGB color in SDL 1.2. Poking around the SDL2
wiki, there seems to be indexed color stuff in there, for instance
"SDL_PIXELFORMAT_INDEX8" and some palette functions for SDL_Surface. There
doesn’t seem to be anything dealing with palettes for SDL_Texture objects.

I know the entire world has since moved to a true color world including
Allegro which I’ve also played with. So are palettes and indexed color even
a real option in SDL2?

If so, I don’t know how to begin. Creating a window and renderer don’t
appear to give me a bits per pixel option. Would it be essentially the same
if I looked for a SDL 1.2 guide on it?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org