Clear WindowResized event boolean at the start of each Poll

This commit is contained in:
Noah 2020-01-01 17:44:11 -08:00
parent e758c46d70
commit 4d008b5c46
2 changed files with 7 additions and 1 deletions

View File

@ -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:

View File

@ -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)