Skip to content

Commit

Permalink
Set cursor on entered instead of every update
Browse files Browse the repository at this point in the history
  • Loading branch information
bhperry committed Aug 23, 2024
1 parent 2de4cad commit ff68666
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 ff68666

Please sign in to comment.