当前位置: 首页>>代码示例>>Golang>>正文


Golang C.SDL_FillRect函数代码示例

本文整理汇总了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
}
开发者ID:willemvds,项目名称:sdl,代码行数:7,代码来源:surface.go

示例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)))
}
开发者ID:rsaarelm,项目名称:teratogen,代码行数:7,代码来源:video.go

示例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)
}
开发者ID:jbondeson,项目名称:Go-SDL2,代码行数:8,代码来源:surface.go

示例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
}
开发者ID:rwcarlsen,项目名称:sdl,代码行数:11,代码来源:sdl.go

示例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)
}
开发者ID:kearsley,项目名称:Go-SDL,代码行数:13,代码来源:sdl.go

示例6: FillRect

func (surface *Surface) FillRect(rect *Rect, color uint32) int {
	return int(C.SDL_FillRect(surface.cptr(), rect.cptr(), C.Uint32(color)))
}
开发者ID:JalfResi,项目名称:go-sdl2,代码行数:3,代码来源:surface.go

示例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))
}
开发者ID:kyleconroy,项目名称:golds,代码行数:6,代码来源:sdl_surface.go

示例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)))
}
开发者ID:rsaarelm,项目名称:teratogen,代码行数:6,代码来源:video.go

示例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
}
开发者ID:emlai,项目名称:go-sdl2,代码行数:7,代码来源:surface.go

示例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)))
}
开发者ID:beoran,项目名称:fungo,代码行数:10,代码来源:video.go


注:本文中的C.SDL_FillRect函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。