作者:willemvd
项目:sd
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
}
作者:rsaarel
项目:teratoge
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)))
}
作者:jbondeso
项目:Go-SDL
// 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)
}
作者:rwcarlse
项目:sd
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
}
作者:kearsle
项目:Go-SD
// 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)
}
作者:JalfRes
项目:go-sdl
func (surface *Surface) FillRect(rect *Rect, color uint32) int {
return int(C.SDL_FillRect(surface.cptr(), rect.cptr(), C.Uint32(color)))
}
作者:kyleconro
项目:gold
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))
}
作者:rsaarel
项目:teratoge
func (s *Surface) Clear(color color.Color) {
mutex.Lock()
defer mutex.Unlock()
C.SDL_FillRect(s.ptr, nil, C.Uint32(s.MapColor(color)))
}
作者:emla
项目:go-sdl
// 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
}
作者:beora
项目:fung
// 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)))
}