aboutsummaryrefslogtreecommitdiff
path: root/core/sys
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2022-05-06 17:28:21 +0200
committerGitHub <noreply@github.com>2022-05-06 17:28:21 +0200
commit6b89ff43eaa621aa4bdb859e367b6d85ea96676e (patch)
tree288b50321f5a6dcd481b6de7af56aade195c4f83 /core/sys
parent53c70da0b83f573d8c1d0572d7a57fd0bac759fc (diff)
parent4cdc55af91f006999637fc786e6e3df5ea913164 (diff)
Merge pull request #1770 from ftphikari/master
sys/windows: fix RGB macro
Diffstat (limited to 'core/sys')
-rw-r--r--core/sys/windows/gdi32.odin4
-rw-r--r--core/sys/windows/types.odin2
2 files changed, 2 insertions, 4 deletions
diff --git a/core/sys/windows/gdi32.odin b/core/sys/windows/gdi32.odin
index e728503d2..898766361 100644
--- a/core/sys/windows/gdi32.odin
+++ b/core/sys/windows/gdi32.odin
@@ -67,8 +67,6 @@ foreign gdi32 {
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 {
- res: [4]u8 = {0, b, g, r}
- return transmute(COLORREF)res
+ return transmute(COLORREF)[4]u8{r, g, b, 0}
}
diff --git a/core/sys/windows/types.odin b/core/sys/windows/types.odin
index c3e461ba0..4093fd3f9 100644
--- a/core/sys/windows/types.odin
+++ b/core/sys/windows/types.odin
@@ -55,7 +55,7 @@ UINT_PTR :: uintptr
ULONG :: c_ulong
UCHAR :: BYTE
NTSTATUS :: c.long
-COLORREF :: DWORD // Windows colors are packed as ABGR
+COLORREF :: DWORD
LPCOLORREF :: ^COLORREF
LPARAM :: LONG_PTR
WPARAM :: UINT_PTR