예제 #1
0
파일: cursor.go 프로젝트: tanema/amore
// 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
}
예제 #2
0
파일: window.go 프로젝트: tanema/amore
// 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
}