Advertisement

[SDL] 15 bit surfaces / Ignoring 6th bit of green

Started by June 26, 2011 01:37 PM
1 comment, last by Modred 13 years, 5 months ago
Hello,

I have to convert a 24bit bmp/png to 16 bit, since that's the colordepth I have to use. Is there a possibility to instruct SDL to convert it to R5G5B5 instead of R5G6B5 when calling SDL_DisplayFormat?
It's only slightly noticable, but greyscale images get a little green touch, that i would like to avoid.

I know it's possible to just iterate the single pixels and shift the 'green' bits one position to the right to gain the same effect, but if there is a more "clean" way, I'd rather use that.


Thanks!
If you don't want it to match the display format, don't call SDL_DisplayFormat(). Blitting between surfaces with different pixel formats can be quite expensive though. It sounds like adjusting the pixels would be a good solution.
Advertisement
Blitting between surfaces with different pixel formats can be quite expensive though. [/quote]

...and it would lead to the same conversation that SDL_DisplayFormat does, wouldn't it? Ok, then I'll do it myself, I guess.

This topic is closed to new replies.

Advertisement