diff --git a/canvas/events.go b/canvas/events.go index bdb2862..e016d9e 100644 --- a/canvas/events.go +++ b/canvas/events.go @@ -161,6 +161,9 @@ func (e *Engine) PollEvent() *Event { func (e *Engine) Poll() (*event.State, error) { s := e.events + // Reset some event states. + s.WindowResized = false + for event := e.PollEvent(); event != nil; event = e.PollEvent() { switch event.Class { case WindowEvent: diff --git a/sdl/events.go b/sdl/events.go index 923b49c..31654f5 100644 --- a/sdl/events.go +++ b/sdl/events.go @@ -12,7 +12,7 @@ import ( var ( DebugWindowEvents = false DebugMouseEvents = false - DebugClickEvents = true + DebugClickEvents = false DebugKeyEvents = false ) @@ -20,6 +20,9 @@ var ( func (r *Renderer) Poll() (*event.State, error) { s := r.events + // Reset some events. + s.WindowResized = false + // helper function to push keyboard key names on keyDown events only. pushKey := func(name string, state uint8) { s.SetKeyDown(name, state == 1)