[SDL] OpenGL Textures

Ryan C. Gordon icculus at clutteredmind.org
Mon Aug 13 12:15:01 PDT 2001

> Then something is wrong with the OpenGL code. File formats have a
> *specified* (if only implicitly by the platform the format originates
> from) byte order, and you should stick to that. Messing with files that
> appear to be of some well known format is generally a very bad idea.

Not necessarily. You can feed BGRA textures to OpenGL as opposed to RGBA
or whatever; in fact, this makes GL code significantly faster on the
Voodoo 1/2/3 chipsets: BGRA is the format that Glide wants, so Mesa is
just going to have to convert every texture in software to get it to the
card if you don't pass it in that format.

OpenGL doesn't understand file formats: just chunks of memory with certain
characteristics. You can feed it RGBA data and tell it it's BGRA if you
want, but doing so explicitly doesn't make the OpenGL code or library


More information about the SDL mailing list