Browse Source

sys/windows: change macro and add comment

hikari 3 years ago
parent
commit
8c7f3fd1e6
1 changed files with 4 additions and 2 deletions
  1. 4 2
      core/sys/windows/gdi32.odin

+ 4 - 2
core/sys/windows/gdi32.odin

@@ -67,6 +67,8 @@ foreign gdi32 {
 	PatBlt :: proc(hdc: HDC, x, y, w, h: c_int, rop: DWORD) -> BOOL ---
 }
 
-RGB :: proc(r, g, b: u8) -> COLORREF {
-	return COLORREF(COLORREF(r) | COLORREF(g) << 8 | COLORREF(b) << 16)
+// Windows colors are packed as ABGR
+RGB :: #force_inline proc "contextless" (r, g, b: u8) -> COLORREF {
+	res: [4]u8 = {0, rgb.b, rgb.g, rgb.r}
+	return transmute(COLORREF)res
 }