예제 #1
0
파일: surface.go 프로젝트: willemvds/sdl
func (s *Surface) FillRect(r *Rect, c uint32) error {
	if C.SDL_FillRect(s.c(), r.c(), C.Uint32(c)) != 0 {
		return getError()
	}

	return nil
}
예제 #2
0
파일: video.go 프로젝트: rsaarelm/teratogen
func (s *Surface) FillRect(rect image.Rectangle, color color.Color) {
	mutex.Lock()
	defer mutex.Unlock()

	sdlRect := convertRect(rect)
	C.SDL_FillRect(s.ptr, &sdlRect, C.Uint32(s.MapColor(color)))
}
예제 #3
0
// This function performs a fast fill of the given rectangle with some color.
func (dst *Surface) FillRect(dstrect *Rect, color uint32) int {
	var ret = C.SDL_FillRect(
		dst.cSurface,
		(*C.SDL_Rect)(cast(dstrect)),
		C.Uint32(color))
	return int(ret)
}
예제 #4
0
파일: sdl.go 프로젝트: rwcarlsen/sdl
func (s *Surface) FillRect(r *Rect, c color.Color) error {
	cr := sdlRect(r)
	if cr != nil {
		defer C.free(unsafe.Pointer(cr))
	}

	if C.SDL_FillRect(s.surf, cr, s.sdlpix(c)) != 0 {
		return sdlerr()
	}
	return nil
}
예제 #5
0
파일: sdl.go 프로젝트: kearsley/Go-SDL
// This function performs a fast fill of the given rectangle with some color.
func (dst *Surface) FillRect(dstrect *Rect, color uint32) int {
	dst.mutex.Lock()

	var ret = C.SDL_FillRect(
		dst.cSurface,
		(*C.SDL_Rect)(cast(dstrect)),
		C.Uint32(color))

	dst.mutex.Unlock()

	return int(ret)
}
예제 #6
0
파일: surface.go 프로젝트: JalfResi/go-sdl2
func (surface *Surface) FillRect(rect *Rect, color uint32) int {
	return int(C.SDL_FillRect(surface.cptr(), rect.cptr(), C.Uint32(color)))
}
예제 #7
0
func (surface *Surface) FillRect(rect *Rect, color uint32) int {
	_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))
	_rect := (*C.SDL_Rect)(unsafe.Pointer(rect))
	_color := (C.Uint32)(color)
	return (int)(C.SDL_FillRect(_surface, _rect, _color))
}
예제 #8
0
파일: video.go 프로젝트: rsaarelm/teratogen
func (s *Surface) Clear(color color.Color) {
	mutex.Lock()
	defer mutex.Unlock()

	C.SDL_FillRect(s.ptr, nil, C.Uint32(s.MapColor(color)))
}
예제 #9
0
파일: surface.go 프로젝트: emlai/go-sdl2
// Surface (https://wiki.libsdl.org/SDL_FillRect)
func (surface *Surface) FillRect(rect *Rect, color uint32) error {
	if C.SDL_FillRect(surface.cptr(), rect.cptr(), C.Uint32(color)) != 0 {
		return GetError()
	}
	return nil
}
예제 #10
0
파일: video.go 프로젝트: beoran/fungo
// This function performs a fast fill of the given rectangle with 'color'
// The given rectangle is clipped to the destination surface clip area
// and the final fill rectangle is saved in the passed in pointer.
// If 'dstrect' is NULL, the whole surface will be filled with 'color'
// The color should be a pixel of the format used by the surface, and
// can be generated by the SDL_MapRGB() function.
// This function returns 0 on success, or -1 on error.
func fillRect(dst *C.SDL_Surface, dstrect *C.SDL_Rect, color uint32) int {
	return int(C.SDL_FillRect(dst, dstrect, C.Uint32(color)))
}