diff options
| author | ewy <ewy0@protonmail.com> | 2026-08-13 15:13:39 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-08-13 15:13:39 +0200 |
| commit | 60f58e548ef745ec072482954ac37c35d88280d4 (patch) | |
| tree | b1d89c0c1e47a427334e7fe708367b1263aaef40 /input/input.go | |
| parent | d0fe29558b040a11c5c8a744c37fbd2e3826f6c4 (diff) | |
switch to single render loop
Diffstat (limited to 'input/input.go')
| -rw-r--r-- | input/input.go | 29 |
1 files changed, 5 insertions, 24 deletions
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) } |
