sys/windows: add a couple macros

This commit is contained in:
hikari
2022-04-07 19:28:24 +03:00
parent ad90f416a5
commit c4a7739d13

View File

@@ -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