Endianness has to do with the processor (Intel, PowerPC, etc.), some
processors store the words (16, 32 or 64bit long depending on the
processor) starting from the lowest byte, and some processors store the
information starting from the highest byte.
therefore, when you create a surface, you have to know if the processor
stores the bytes starting from the lowest byte of starting from the
highest byte. For example:
We have a pointer “p”, and we make
*p=0x11223344
Now we create a byte pointer: char *p2=(char *)p
If the processor starting from the loest byte, p2[0]=0x44, but if the
processor stores the information starting from the highest byte, p2[0]=0x11.
This is called “endianness”, there are BIG_ENDIAN processors and
LOW_ENDIAN procesors. The information is needed to know where to place
the R,G,B and A channels inside the pixels of a surface.
I hope theexplanation is understandable!!
santi> Hello!
Looking on some source, i saw this:
…
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
…
This BIG_ENDIAN has something to do with network / host byte order?
I knew that “Big Endian” word from Sockets… and just wanted to
know what
this represents in SDL.
Thanks you
Eduardo Garcia Rajo (h)
Visite: http://www.solucion-digital.com.ar
SOLUCION DIGITAL
Redes - Software - Servicios