examples: draw: Handle different endianness for cursor colour

pull/63/head
Andri Yngvason 2022-02-12 13:28:15 +00:00
parent c876b91541
commit adce5170ee
1 changed files with 6 additions and 1 deletions

View File

@ -96,7 +96,12 @@ static struct nvnc_fb* create_cursor()
struct nvnc_fb* fb = nvnc_fb_new(32, 32, DRM_FORMAT_RGBA8888, 32); struct nvnc_fb* fb = nvnc_fb_new(32, 32, DRM_FORMAT_RGBA8888, 32);
assert(fb); assert(fb);
uint32_t colour = 0x0000ffff; #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
uint32_t colour = 0x00ff00ffULL;
#else
uint32_t colour = 0xff00ff00ULL;
#endif
uint32_t* pixels = nvnc_fb_get_addr(fb); uint32_t* pixels = nvnc_fb_get_addr(fb);
for (int i = 0; i < 32 * 32; ++i) { for (int i = 0; i < 32 * 32; ++i) {