Beispiel #1
0
// CreateSoftwareRenderer (https://wiki.libsdl.org/SDL_CreateSoftwareRenderer)
func CreateSoftwareRenderer(surface *Surface) (*Renderer, error) {
	_renderer := C.SDL_CreateSoftwareRenderer(surface.cptr())
	if _renderer == nil {
		return nil, GetError()
	}
	return (*Renderer)(unsafe.Pointer(_renderer)), nil
}
Beispiel #2
0
func (s *Surface) CreateSoftwareRenderer() (*Renderer, error) {
	r := C.SDL_CreateSoftwareRenderer(s.c())
	if r == nil {
		return nil, getError()
	}

	return &Renderer{r}, nil
}
Beispiel #3
0
func CreateSoftwareRenderer(surface *Surface) *Renderer {
	_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))
	return (*Renderer)(unsafe.Pointer(C.SDL_CreateSoftwareRenderer(_surface)))
}
Beispiel #4
0
func CreateSoftwareRenderer(surface *Surface) *Renderer {
	return (*Renderer)(unsafe.Pointer(C.SDL_CreateSoftwareRenderer(surface.cptr())))
}