Skip to content

Commit

Permalink
Merge pull request #115 from bhperry/set-cursor-on-entered
Browse files Browse the repository at this point in the history
Set cursor on entered instead of every update
  • Loading branch information
bhperry authored Aug 23, 2024
2 parents 2de4cad + ff68666 commit 4c07641
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions backends/opengl/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ func (w *Window) initInput() {
})

w.window.SetCursorEnterCallback(func(_ *glfw.Window, entered bool) {
if entered && w.cursor != nil {
w.window.SetCursor(w.cursor)
}
w.input.MouseEnteredEvent(entered)
if w.mouseEnteredCallback != nil {
w.mouseEnteredCallback(w, entered)
Expand Down
1 change: 0 additions & 1 deletion backends/opengl/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ func (w *Window) Destroy() {

// Update swaps buffers and polls events. Call this method at the end of each frame.
func (w *Window) Update() {
w.SetCursor(w.cursor)
w.SwapBuffers()
w.UpdateInput()
}
Expand Down

0 comments on commit 4c07641

Please sign in to comment.