SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL3pp_endian.h
1#ifndef SDL3PP_ENDIAN_H_
2#define SDL3PP_ENDIAN_H_
3
4#include <SDL3/SDL_endian.h>
5#include "SDL3pp_stdinc.h"
6
7namespace SDL {
8
30#ifdef SDL3PP_DOC
31
49#define SDL_LIL_ENDIAN 1234
50
68#define SDL_BIG_ENDIAN 4321
69
88#define SDL_BYTEORDER SDL_LIL_ENDIAN___or_maybe___SDL_BIG_ENDIAN
89
108#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN___or_maybe___SDL_BIG_ENDIAN
109
110#endif // SDL3PP_DOC
111
131constexpr float SwapFloat(float x) { return SDL_SwapFloat(x); }
132
152constexpr Uint16 Swap16(Uint16 x) { return SDL_Swap16(x); }
153
173constexpr Uint32 Swap32(Uint32 x) { return SDL_Swap32(x); }
174
194constexpr Uint32 Swap64(Uint64 x) { return SDL_Swap64(x); }
195
210constexpr Uint16 Swap16LE(Uint16 x) { return SDL_Swap16LE(x); }
211
226constexpr Uint32 Swap32LE(Uint32 x) { return SDL_Swap32LE(x); }
227
242constexpr Uint64 Swap64LE(Uint64 x) { return SDL_Swap64LE(x); }
243
258constexpr float SwapFloatLE(float x) { return SDL_SwapFloatLE(x); }
259
274constexpr Uint16 Swap16BE(Uint16 x) { return SDL_Swap16BE(x); }
275
290constexpr Uint32 Swap32BE(Uint32 x) { return SDL_Swap32BE(x); }
291
306constexpr Uint64 Swap64BE(Uint64 x) { return SDL_Swap64BE(x); }
307
322constexpr float SwapFloatBE(float x) { return SDL_SwapFloatBE(x); }
323
325
326} // namespace SDL
327
328#endif /* SDL3PP_ENDIAN_H_ */
constexpr Uint16 Swap16(Uint16 x)
Byte-swap an unsigned 16-bit number.
Definition SDL3pp_endian.h:152
constexpr Uint16 Swap16BE(Uint16 x)
Swap a 16-bit value from bigendian to native byte order.
Definition SDL3pp_endian.h:274
constexpr Uint64 Swap64LE(Uint64 x)
Swap a 64-bit value from littleendian to native byte order.
Definition SDL3pp_endian.h:242
constexpr Uint64 Swap64BE(Uint64 x)
Swap a 64-bit value from bigendian to native byte order.
Definition SDL3pp_endian.h:306
constexpr float SwapFloatBE(float x)
Swap a floating point value from bigendian to native byte order.
Definition SDL3pp_endian.h:322
constexpr float SwapFloatLE(float x)
Swap a floating point value from littleendian to native byte order.
Definition SDL3pp_endian.h:258
constexpr Uint32 Swap32(Uint32 x)
Byte-swap an unsigned 32-bit number.
Definition SDL3pp_endian.h:173
constexpr Uint32 Swap32BE(Uint32 x)
Swap a 32-bit value from bigendian to native byte order.
Definition SDL3pp_endian.h:290
constexpr float SwapFloat(float x)
Byte-swap a floating point number.
Definition SDL3pp_endian.h:131
constexpr Uint32 Swap32LE(Uint32 x)
Swap a 32-bit value from littleendian to native byte order.
Definition SDL3pp_endian.h:226
constexpr Uint32 Swap64(Uint64 x)
Byte-swap an unsigned 64-bit number.
Definition SDL3pp_endian.h:194
constexpr Uint16 Swap16LE(Uint16 x)
Swap a 16-bit value from littleendian to native byte order.
Definition SDL3pp_endian.h:210
the main namespace where all SDL3pp public functions and types live
Definition SDL3pp_assert.h:7