diff --git a/pixelgl/input.go b/pixelgl/input.go index ff98805d29d14b22be882d0a67cbcd1bbdf7aabd..2eedb0dc9362330cc7f36e16367d2fb0ecb05f2d 100644 --- a/pixelgl/input.go +++ b/pixelgl/input.go @@ -372,7 +372,9 @@ func (w *Window) initInput() { }) } -func (w *Window) updateInput() { +// 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() }) diff --git a/pixelgl/window.go b/pixelgl/window.go index cb4dcf3881f963bff4028eb209986095004357ce..e501cc543adc09c3350e7c52957adefda8cb391a 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.