Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make StandardCursor an alias #118

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading