Skip to content

Commit

Permalink
Make StandardCursor an alias (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
dusk125 authored Aug 30, 2024
1 parent 8f8ea78 commit 40ac60a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions backends/opengl/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ import (
"github.com/gopxl/pixel/v2"
)

type StandardCursor int
type StandardCursor = glfw.StandardCursor

const (
ArrowCursor = StandardCursor(glfw.ArrowCursor)
IBeamCursor = StandardCursor(glfw.IBeamCursor)
CrosshairCursor = StandardCursor(glfw.CrosshairCursor)
HandCursor = StandardCursor(glfw.HandCursor)
HResizeCursor = StandardCursor(glfw.HResizeCursor)
VResizeCursor = StandardCursor(glfw.VResizeCursor)
ArrowCursor = glfw.ArrowCursor
IBeamCursor = glfw.IBeamCursor
CrosshairCursor = glfw.CrosshairCursor
HandCursor = glfw.HandCursor
HResizeCursor = glfw.HResizeCursor
VResizeCursor = glfw.VResizeCursor
)

type Cursor = glfw.Cursor

// CreateStandardCursor creates a new standard cursor.
func CreateStandardCursor(cursorId StandardCursor) *Cursor {
c := mainthread.CallVal(func() *Cursor {
return glfw.CreateStandardCursor(glfw.StandardCursor(cursorId))
return glfw.CreateStandardCursor(cursorId)
})
runtime.SetFinalizer(c, (*Cursor).Destroy)
return c
Expand Down

0 comments on commit 40ac60a

Please sign in to comment.