After reading through a few articles on the problems of 16bit RGB formats on vid cards, I've finally (almost) got it licked.
What I'm not sure on is how to actually implement the different variations in my code. I can detect the format etc., that isn't the problem... Hmm, this is hard to explain.
What I mean is, say I have a 5-5-5 graphics card. Pure white will therefore me (31,31,31). But say I then use the code on a 5-6-5 format graphics card... It'll be a pinky colour. Basically what I'm asking is, do I pick say 5-6-5 as my primary format (65k colours) and then reduce (ie. divide by 2 the green componet) for a 5-5-5 card etc.?
Also, is it better to (at each point in my code where I want to draw a pixel say) have an if() or switch() kinda thing or should I use a macro which encompasses everything (but has a lot of shifts...)?
I'm sorry if I haven't made sense... basically I know how to detect the format, the shifts needed etc, just not how to implement them (in an optimized way).
Any help would be appreciated