Merge pull request #1770 from ftphikari/master

sys/windows: fix RGB macro
This commit is contained in:
Jeroen van Rijn
2022-05-06 17:28:21 +02:00
committed by GitHub
2 changed files with 2 additions and 4 deletions
+1 -3
View File
@@ -67,8 +67,6 @@ foreign gdi32 {
PatBlt :: proc(hdc: HDC, x, y, w, h: c_int, rop: DWORD) -> BOOL --- PatBlt :: proc(hdc: HDC, x, y, w, h: c_int, rop: DWORD) -> BOOL ---
} }
// Windows colors are packed as ABGR
RGB :: #force_inline proc "contextless" (r, g, b: u8) -> COLORREF { RGB :: #force_inline proc "contextless" (r, g, b: u8) -> COLORREF {
res: [4]u8 = {0, b, g, r} return transmute(COLORREF)[4]u8{r, g, b, 0}
return transmute(COLORREF)res
} }
+1 -1
View File
@@ -55,7 +55,7 @@ UINT_PTR :: uintptr
ULONG :: c_ulong ULONG :: c_ulong
UCHAR :: BYTE UCHAR :: BYTE
NTSTATUS :: c.long NTSTATUS :: c.long
COLORREF :: DWORD // Windows colors are packed as ABGR COLORREF :: DWORD
LPCOLORREF :: ^COLORREF LPCOLORREF :: ^COLORREF
LPARAM :: LONG_PTR LPARAM :: LONG_PTR
WPARAM :: UINT_PTR WPARAM :: UINT_PTR