Compare commits

...

2 commits

Author SHA1 Message Date
Able 6a319c55b0 Proper Y direction 2024-11-05 23:01:15 -06:00
Able 879bbfa173 rework logic 2024-11-05 23:01:06 -06:00
2 changed files with 2 additions and 5 deletions

View file

@ -26,10 +26,7 @@ recieve_mouse_event := fn(): ?^MouseEvent {
// Read out of the Mouse buffer here
buffer.recv(MouseEvent, buf_id, mem_page)
if *mem_page == 0 {
// log.info("Haha\0")
} else {
log.info("Mouse event recieved in horizon.\0")
if *mem_page != 0 {
dx := *mem_page
dy := *mem_page + 1
mevent := MouseEvent.(dx, dy, 0, 0, 0)

View file

@ -71,7 +71,7 @@ main := fn(): int {
mouse_event := intouch.recieve_mouse_event()
if mouse_event != null {
mouse_x += mouse_event.x_change
mouse_y -= mouse_event.y_change
mouse_y += mouse_event.y_change
}
// render mouse
render.put_rect(screen, .(mouse_x, mouse_y), .(20, 20), render.white)