diff options
| author | hikari <ftphikari@gmail.com> | 2022-04-07 19:28:24 +0300 |
|---|---|---|
| committer | hikari <ftphikari@gmail.com> | 2022-04-07 19:28:24 +0300 |
| commit | c4a7739d13d386743a53ebe3371e8061310ea2cb (patch) | |
| tree | 73889e7945e1fd9e12c8ae1c5c36ae25f2936f9c /core/sys | |
| parent | ad90f416a59be22dbf8fca89890a70407dc5826c (diff) | |
sys/windows: add a couple macros
Diffstat (limited to 'core/sys')
| -rw-r--r-- | core/sys/windows/util.odin | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/sys/windows/util.odin b/core/sys/windows/util.odin index d464007d3..f448f6bc5 100644 --- a/core/sys/windows/util.odin +++ b/core/sys/windows/util.odin @@ -15,6 +15,14 @@ HIWORD :: #force_inline proc "contextless" (x: DWORD) -> WORD { return WORD(x >> 16) } +GET_X_LPARAM :: #force_inline proc "contextless" (lp: LPARAM) -> c_int { + return cast(c_int)cast(c_short)LOWORD(cast(DWORD)lp) +} + +GET_Y_LPARAM :: #force_inline proc "contextless" (lp: LPARAM) -> c_int { + return cast(c_int)cast(c_short)HIWORD(cast(DWORD)lp) +} + utf8_to_utf16 :: proc(s: string, allocator := context.temp_allocator) -> []u16 { if len(s) < 1 { return nil |