aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhikari <ftphikari@gmail.com>2022-04-30 13:34:11 +0300
committerhikari <ftphikari@gmail.com>2022-04-30 13:34:11 +0300
commit8c7f3fd1e6f9b04da2b01e25bd7a5dee6feeee28 (patch)
tree7ba3ad3d21a5b5f7511b65323f0913525fdf2297
parent40bea95fb0c1f561f2bb53c967c698823c8c951b (diff)
sys/windows: change macro and add comment
-rw-r--r--core/sys/windows/gdi32.odin6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/sys/windows/gdi32.odin b/core/sys/windows/gdi32.odin
index eb863b586..bec5225a7 100644
--- a/core/sys/windows/gdi32.odin
+++ b/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
}