Clear WindowResized event boolean at the start of each Poll
This commit is contained in:
parent
e758c46d70
commit
4d008b5c46
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user