Wiki Page Content

Differences between revisions 17 and 18
Revision 17 as of 2011-12-29 18:20:19
Size: 1694
Editor: SheenaSmith
Comment: remove draft
Revision 18 as of 2012-01-04 18:49:58
Size: 1712
Editor: SheenaSmith
Comment: cached searchs
Deletions are marked like this. Additions are marked like this.
Line 34: Line 34:
##<<FullSearch(category:CategoryEnum CategoryEndian -SGEnumerations)>> ##<<FullSearchCached(category:CategoryEnum CategoryEndian -SGEnumerations)>>
Line 37: Line 37:
##<<FullSearch(category:CategoryStruct CategoryEndian -SGStructures)>> ##<<FullSearchCached(category:CategoryStruct CategoryEndian -SGStructures)>>
Line 40: Line 40:
<<FullSearch(category:CategoryEndian -CategoryEnum -CategoryStruct -SGFunctions)>> <<FullSearchCached(category:CategoryEndian -CategoryEnum -CategoryStruct -SGFunctions)>>

Byte Order and Byte Swapping

Include File(s): SDL_endian.h

Introduction

This category contains functions for handling endian-specific values.

Endianness comes in two forms - big and little.

  • SDL_LIL_ENDIAN means byte order is 1234, where the smaller (little) numbered position comes first
  • SDL_BIG_ENDIAN means byte order is 4321, where the larger (big) numbered position comes first
  • Example: Imagine the hexadecimal sequence in byte form of DE AD BE EF

    • When the bytes are read as a little-endian value, the bytes are read lowest byte first, producing the value:
      • 0xEFBEADDE

      When the bytes are read as a big-endian value, the bytes are read highest byte first, producing the value:
      • 0xDEADBEEF

SDL_BYTEORDER is a macro that corresponds to the byte order used by the processor type it was compiled for.

  • SDL_BYTEORDER is SDL_LIL_ENDIAN for x86, x64, and similar systems that use the little endian byte order.
  • SDL_BYTEORDER is SDL_BIG_ENDIAN for PowerPC and similar systems that use the big endian byte order.

Functions


CategoryCategory

None: CategoryEndian (last edited 2017-02-19 20:43:49 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit