diff options
| author | hikari <ftphikari@gmail.com> | 2022-04-30 11:21:37 +0300 |
|---|---|---|
| committer | hikari <ftphikari@gmail.com> | 2022-04-30 11:21:37 +0300 |
| commit | 0ad448f1c71da7bc522012a894f02c9864e448d6 (patch) | |
| tree | 0f6f2e394aec1b18ea0f7454a6f12e8826f8916c | |
| parent | e53ba3b11612db5c52ecf9b523e4d0ed87f7b1ad (diff) | |
sys/windows: add a couple of procedures and types
| -rw-r--r-- | core/image/common.odin | 2 | ||||
| -rw-r--r-- | core/sys/windows/gdi32.odin | 5 | ||||
| -rw-r--r-- | core/sys/windows/types.odin | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/core/image/common.odin b/core/image/common.odin index 8c77ec48a..9955f0ee1 100644 --- a/core/image/common.odin +++ b/core/image/common.odin @@ -1131,4 +1131,4 @@ write_bytes :: proc(buf: ^bytes.Buffer, data: []u8) -> (err: compress.General_Er return compress.General_Error.Resize_Failed } return nil -}
\ No newline at end of file +} diff --git a/core/sys/windows/gdi32.odin b/core/sys/windows/gdi32.odin index 15d5567c7..8c686f2dc 100644 --- a/core/sys/windows/gdi32.odin +++ b/core/sys/windows/gdi32.odin @@ -62,5 +62,10 @@ foreign gdi32 { ChoosePixelFormat :: proc(hdc: HDC, ppfd: ^PIXELFORMATDESCRIPTOR) -> c_int --- SwapBuffers :: proc(HDC) -> BOOL --- + SetDCBrushColor :: proc(hdc: HDC, color: COLORREF) -> COLORREF --- 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) +} diff --git a/core/sys/windows/types.odin b/core/sys/windows/types.odin index 6bded29e1..4093fd3f9 100644 --- a/core/sys/windows/types.odin +++ b/core/sys/windows/types.odin @@ -55,6 +55,8 @@ UINT_PTR :: uintptr ULONG :: c_ulong UCHAR :: BYTE NTSTATUS :: c.long +COLORREF :: DWORD +LPCOLORREF :: ^COLORREF LPARAM :: LONG_PTR WPARAM :: UINT_PTR LRESULT :: LONG_PTR |