Sdl_byteorder

Hi Guys
i see on your docs for creating surfaces you have #if SDL_BYTEORDER
== SDL_BIG_ENDIAN i was wondering whats its relevance, IE is it Video Card
base, Os Based or personal choice based.

Trish

Hi Guys
i see on your docs for creating surfaces you have #if
SDL_BYTEORDER
== SDL_BIG_ENDIAN i was wondering whats its relevance, IE is it Video Card
base, Os Based or personal choice based.

The adjectives big-endian and little endian refer to which bytes are most
significant in multi-byte data types and describe the order in which a
sequence of bytes is stored in a computer’s memory.
In a big-endian system, the most significant value in the sequence is stored
at the lowest storage address (i.e., first). In a little-endian system, the
least significant value in the sequence is stored first.

Why this is relevant in SDL is because in 16bit or higher screenmodes, there
is no palette, but colors are stored directly on the surface, in RGB format.
The position of the induvidual color components depends on wether the system
is big- or little-endian.

Cheers,

“The position of the induvidual color components depends on wether the *
system
*is big- or little-endian.”

you say system, is that system as in linux one system and windows another
system or are you saying my pc is one system and jo blogs system is another
system (both running windows)?

Trish

“The position of the induvidual color components depends on wether the *
system
*is big- or little-endian.”

you say system, is that system as in linux one system and windows another
system or are you saying my pc is one system and jo blogs system is
another
system (both running windows)?

I think it is a processor trait. x86 processors are little endian, which
incidentaly is also referred to at times as the “Intel format”. Most
Motorola processors use big endian. Some processors are able to switch
between the two modes.

http://3bc.bertrand-blanc.com/endianness05.pdf

Will probably explain things alot better than I ever could :slight_smile:

Cheers,

System refers to the PC architecture, for example intel x86 and clones
versus Motorola processors. Intels are little-endian and Motorolas
are (AFAIK) big endian. Big endian is also called "network endian"
since it is the supposed standard endianess used when transmitting
binary data (as opposed to text, which is endian neutral ) over
networks.On 3/22/07, Patricia Curtis <patricia.curtis at gmail.com> wrote:

“The position of the induvidual color components depends on wether the
system
is big- or little-endian.”

you say system, is that system as in linux one system and windows another
system or are you saying my pc is one system and jo blogs system is another
system (both running windows)?

Trish


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org