Exemplo n.º 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
}
Exemplo n.º 2
0
func (s *Surface) CreateSoftwareRenderer() (*Renderer, error) {
	r := C.SDL_CreateSoftwareRenderer(s.c())
	if r == nil {
		return nil, getError()
	}

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