コード例 #1
0
ファイル: mouse.go プロジェクト: willemvds/sdl
func (s *Surface) CreateColorCursor(hx, hy int) (*Cursor, error) {
	c := C.SDL_CreateColorCursor(s.c(), C.int(hx), C.int(hy))
	if c == nil {
		return nil, getError()
	}

	return &Cursor{c}, nil
}
コード例 #2
0
ファイル: sdl_mouse.go プロジェクト: kyleconroy/golds
func CreateColorCursor(surface *Surface, hot_x, hot_y int) *Cursor {
	_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))
	_hot_x := (C.int)(hot_x)
	_hot_y := (C.int)(hot_y)
	return (*Cursor)(C.SDL_CreateColorCursor(_surface, _hot_x, _hot_y))
}
コード例 #3
0
ファイル: mouse.go プロジェクト: veandco/go-sdl2
// CreateColorCursor (https://wiki.libsdl.org/SDL_CreateColorCursor)
func CreateColorCursor(surface *Surface, hotX, hotY int) *Cursor {
	return (*Cursor)(C.SDL_CreateColorCursor(surface.cptr(), C.int(hotX), C.int(hotY)))
}