I’m writing a program with SDL and OpenGL
that currently loads an MD2 model textured
with a PCX file.
When I load the same texture as a TGA
(all of this with the SDL_image library)
I notice that the Red and Blue values
appear to be swapped. I attribute this
to the fact that PCX files are RGB while
TGA files are BGR (or something like that).
How would I change the format to RGB after
the SDL_Surface is loaded.
I’m guessing I need to loop through
surface->pixels swapping some values. Anyone
help out?
Also, how can I detect what format the image
is in, so I know whether to swap or not.