From 60f58e548ef745ec072482954ac37c35d88280d4 Mon Sep 17 00:00:00 2001 From: ewy Date: Thu, 13 Aug 2026 15:13:39 +0200 Subject: switch to single render loop --- input/input.go | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'input/input.go') diff --git a/input/input.go b/input/input.go index 48eeb02..5a0dea7 100644 --- a/input/input.go +++ b/input/input.go @@ -1,30 +1,11 @@ package input -import "ponger/ecs" +import "ponger/events" -type DeviceID int - -type Event struct { - ecs.Event - Which DeviceID - Dx, Dy float32 - JustPressed, JustReleased, IsPressed bool -} - -type Handler interface { - Process(ev Event) +type MouseMotionHandler interface { + ProcessMouseMotion(ev events.MouseMotion) } -func ProcessTree(root any, ev Event) { - if inp, ok := root.(Handler); ok { - inp.Process(ev) - } - if g, ok := root.(ecs.IsGameObject); ok { - for _, c := range g.GO().Children { - if c == nil { - continue - } - ProcessTree(c, ev) - } - } +type MousePressHandler interface { + ProcessMousePress(ev events.MousePress) } -- cgit v1.3.1