本文整理汇总了Golang中C.SDL_FillRect函数的典型用法代码示例。如果您正苦于以下问题:Golang SDL_FillRect函数的具体用法?Golang SDL_FillRect怎么用?Golang SDL_FillRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SDL_FillRect函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: FillRect
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: FillRect
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: FillRect
// 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: FillRect
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: FillRect
// 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: FillRect
func (surface *Surface) FillRect(rect *Rect, color uint32) int {
return int(C.SDL_FillRect(surface.cptr(), rect.cptr(), C.Uint32(color)))
}
示例7: FillRect
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: Clear
func (s *Surface) Clear(color color.Color) {
mutex.Lock()
defer mutex.Unlock()
C.SDL_FillRect(s.ptr, nil, C.Uint32(s.MapColor(color)))
}
示例9: FillRect
// 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: fillRect
// 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)))
}