The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
[1.2]-Windows&Linux(GL_RGBA)-OSX(GL_BGRA)???
JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
Hi,

When using:
OpenGL "glTexImage2D" function:
On Windows and Linux, I must use:
GL_RGBA
but on Mac OS X, I must use:
GL_BGRA
for format of pixel data value in above function.

Was wondering why?

Thanks!

Jesse
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Net_Raider


Joined: 12 Sep 2010
Posts: 3
because the endiannes of these systems isn't the same
windows and linux (intel architectures - x86 and next) are little endian
macs (ppc architecture) are big endian
[1.2]-Windows&Linux(GL_RGBA)-OSX(GL_BGRA)???
Paul Melis
Guest

On 09/13/10 17:12, Net_Raider wrote:
Quote:
because the endiannes of these systems isn't the same
windows and linux (intel architectures - x86 and next) are little endian
macs (ppc architecture) are big endian
The endianess shouldn't matter as long as you supply the correct color enums to glTexImage2D OpenGL will perform the necessary conversions. Perhaps the reading of your color data from disk isn't correct on a system with different endianness.

Paul