'Event_Mouse_Delta', Raw Input, WM_INPUT
This commit is contained in:
13
window.odin
13
window.odin
@@ -11,6 +11,8 @@ Window :: struct {
|
||||
backend: Backend_Info,
|
||||
|
||||
event_queue: Event_Queue,
|
||||
|
||||
mouse_delta: [2]i32,
|
||||
}
|
||||
|
||||
Event_Queue :: queue.Queue(Event)
|
||||
@@ -52,12 +54,16 @@ Event_Keyboard :: struct {
|
||||
Event_Mouse :: union {
|
||||
Event_Mouse_Move,
|
||||
Event_Mouse_Button,
|
||||
Event_Mouse_Delta,
|
||||
}
|
||||
Event_Mouse_Move :: struct {
|
||||
x, y: u16,
|
||||
}
|
||||
Mouse_Button :: enum { Left, Middle, Right }
|
||||
Event_Mouse_Button :: struct { button: Mouse_Button, state: Event_Input_State }
|
||||
Event_Mouse_Delta :: struct {
|
||||
x, y: i32,
|
||||
}
|
||||
|
||||
Event_Input :: union {
|
||||
Event_Keyboard,
|
||||
@@ -126,11 +132,12 @@ cursor_visible :: proc(window: ^Window) -> bool {
|
||||
return false
|
||||
}
|
||||
|
||||
set_cursor_position :: proc(window: ^Window, pos: [2]u32) {
|
||||
// fmt.printfln("Set cursor pos: %v:%v", pos.x, pos.y)
|
||||
lock_cursor :: proc(window: ^Window, lock: bool) {
|
||||
when ODIN_OS == .Windows {
|
||||
set_cursor_position_windows(window, pos)
|
||||
lock_cursor_windows(window, lock)
|
||||
}
|
||||
|
||||
show_cursor_window(window, !lock)
|
||||
}
|
||||
|
||||
get_pointer_to_surface :: proc(window: ^Window) -> rawptr {
|
||||
|
||||
Reference in New Issue
Block a user