// NewCursor creates a new hardware Cursor object from an image. func NewCursor(filename string, hx, hy int) (*sdl.Cursor, error) { new_surface, err := surface.Load(filename) if err != nil { return nil, err } cursor := sdl.CreateColorCursor(new_surface, hx, hy) new_surface.Free() return cursor, nil }
// SetIcon sets the small icon on the display bar as well as the large icon on the // task bar and icon on the dock in osx func SetIcon(path string) error { win := getCurrent() win.Config.Icon = path new_surface, err := surface.Load(path) if err != nil { return err } win.sdl_window.SetIcon(new_surface) new_surface.Free() return nil }