From 6c69d9b06b50d00fa39eabcb74bba53f93182ac5 Mon Sep 17 00:00:00 2001 From: mewmew Date: Mon, 1 Jan 2018 21:04:56 +0100 Subject: [PATCH 1/2] pixelgl: export UpdateInput --- pixelgl/input.go | 3 ++- pixelgl/window.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pixelgl/input.go b/pixelgl/input.go index ff98805..d8cbf1b 100644 --- a/pixelgl/input.go +++ b/pixelgl/input.go @@ -372,7 +372,8 @@ func (w *Window) initInput() { }) } -func (w *Window) updateInput() { +// UpdateInput polls window events. +func (w *Window) UpdateInput() { mainthread.Call(func() { glfw.PollEvents() }) diff --git a/pixelgl/window.go b/pixelgl/window.go index cb4dcf3..e501cc5 100644 --- a/pixelgl/window.go +++ b/pixelgl/window.go @@ -192,7 +192,7 @@ func (w *Window) Update() { w.end() }) - w.updateInput() + w.UpdateInput() } // SetClosed sets the closed flag of the Window. From 98be0b43c89a6db65813cd56ef29d2ad1fa75cd8 Mon Sep 17 00:00:00 2001 From: mewmew Date: Thu, 4 Jan 2018 19:23:53 +0100 Subject: [PATCH 2/2] pixelgl: clarify UpdateInput docs --- pixelgl/input.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pixelgl/input.go b/pixelgl/input.go index d8cbf1b..2eedb0d 100644 --- a/pixelgl/input.go +++ b/pixelgl/input.go @@ -372,7 +372,8 @@ func (w *Window) initInput() { }) } -// UpdateInput polls window events. +// UpdateInput polls window events. Call this function to poll window events +// without swapping buffers. Note that the Update method invokes UpdateInput. func (w *Window) UpdateInput() { mainthread.Call(func() { glfw.PollEvents()