Mr Haerr.
I agree to use MW_CPU_BIG_ENDIAN.
Because, the microwindow can support various toolchain.
My tested code might be applicable only for arm-linux-gcc.
I had tested the following for BIG ENDIAN case.
1) compile with -D__ARMEB__ option.
2) #include
3) conditional compile statement is
#if __BYTE_ORDER == __LITTLE_ENDIAN
// littile endian part
#elif __BYTE_ORDER == __BIG_ENDIAN
// big endian part
#endif
My ARM toolchain has "include/endian.h", "incude/bits/endian.h".
"include/bits/endian.h"'s content is the following.
#ifdef __ARMEB__
#define __BYTE_ORDER __BIG_ENDIAN
#else
#define __BYTE_ORDER __LITTLE_ENDIAN
#endif
Regards,
Sung Joo
-----Original Message-----
From: "Greg Haerr"<g...@censoft.com>
To: "Sung Joo, Byun"<nh...@naver.com>
Cc: nanogui@linuxhacker.org
Sent: 10-03-19(금) 04:47:25
Subject: Re: Re: [nanogui] Re: Re: [FIX] add alpha channel into GdDrawImage
software handling
: Your code assumes the same order for declaration
: of the unsigned char r:5, g:6, b:5 structure.
Actually I understand now, we'll just use the
MW_CPU_BIG_ENDIAN flag and assume
that the C bitfields are allocated MSB->LSB
in the big endian case, which works without
requiring a later byte swap.
I'll apply your patch later this evening!
Regards,
Greg