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


Golang C.SDL_SetClipRect函数代码示例

本文整理汇总了Golang中C.SDL_SetClipRect函数的典型用法代码示例。如果您正苦于以下问题:Golang SDL_SetClipRect函数的具体用法?Golang SDL_SetClipRect怎么用?Golang SDL_SetClipRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SDL_SetClipRect函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: PushViewport

//Pushs a viewport to limit the drawing space to the given bounds within the current drawing space.
//Will not accept any negative values.
func (me *Canvas) PushViewport(x, y, width, height int) {
	me.origin.SubtractFrom(me.viewport.translate())
	me.viewport.push(util.Bounds{util.Point{X: int(x), Y: int(y)}, util.Size{Width: int(width), Height: int(height)}})
	r := toSDL_Rect(me.viewport.bounds())
	C.SDL_SetClipRect(me.pane, &r)
	me.origin = me.translation.AddOf(me.viewport.bounds().Point)
	me.origin.AddTo(me.viewport.translate())
}
开发者ID:griffy,项目名称:starfish,代码行数:10,代码来源:canvas.go

示例2: PopViewport

//Exits the current viewport, unless there is no viewport.
func (me *Canvas) PopViewport() {
	if me.viewport.pt != 0 {
		me.origin.SubtractFrom(me.viewport.translate())
		me.viewport.pop()
		r := toSDL_Rect(me.viewport.bounds())
		C.SDL_SetClipRect(me.pane, &r)
		me.origin = me.translation.AddOf(me.viewport.bounds().Point)
		me.origin.AddTo(me.viewport.translate())
	}
}
开发者ID:griffy,项目名称:starfish,代码行数:11,代码来源:canvas.go

示例3: SetClipRect

// Sets the clipping rectangle for a surface.
func (s *Surface) SetClipRect(r *Rect) {
	s.mutex.Lock()
	C.SDL_SetClipRect(s.cSurface, (*C.SDL_Rect)(cast(r)))
	s.mutex.Unlock()
}
开发者ID:kearsley,项目名称:Go-SDL,代码行数:6,代码来源:sdl.go

示例4: SetClipRect

func (surface *Surface) SetClipRect(rect *Rect) bool {
	return C.SDL_SetClipRect(surface.cptr(), rect.cptr()) > 0
}
开发者ID:JalfResi,项目名称:go-sdl2,代码行数:3,代码来源:surface.go

示例5: SetClipRect

// Sets the clipping rectangle for a surface.
func (s *Surface) SetClipRect(r *Rect) {
	C.SDL_SetClipRect((*C.SDL_Surface)(cast(s)), (*C.SDL_Rect)(cast(r)))
	return
}
开发者ID:gnanderson,项目名称:Go-SDL,代码行数:5,代码来源:sdl.go

示例6: SetClipRect

func (surface *Surface) SetClipRect(rect *Rect) bool {
	_surface := (*C.SDL_Surface)(unsafe.Pointer(surface))
	_rect := (*C.SDL_Rect)(unsafe.Pointer(rect))
	return C.SDL_SetClipRect(_surface, _rect) > 0
}
开发者ID:kyleconroy,项目名称:golds,代码行数:5,代码来源:sdl_surface.go

示例7: SetClipRect

func (s *Surface) SetClipRect(r *Rect) bool {
	return C.SDL_SetClipRect(s.c(), r.c()) == C.SDL_TRUE
}
开发者ID:willemvds,项目名称:sdl,代码行数:3,代码来源:surface.go

示例8: ClearClipRect

func (s *Surface) ClearClipRect() {
	C.SDL_SetClipRect(s.ptr, nil)
}
开发者ID:rsaarelm,项目名称:teratogen,代码行数:3,代码来源:video.go

示例9: SetClipRect

func (s *Surface) SetClipRect(rect image.Rectangle) {
	r := convertRect(rect)
	C.SDL_SetClipRect(s.ptr, &r)
}
开发者ID:rsaarelm,项目名称:teratogen,代码行数:4,代码来源:video.go

示例10: SetClipRect

// Sets the clipping rectangle for a surface.
func (s *Surface) SetClipRect(r *Rect) {
	C.SDL_SetClipRect(s.cSurface, (*C.SDL_Rect)(cast(r)))
}
开发者ID:jbondeson,项目名称:Go-SDL2,代码行数:4,代码来源:surface.go

示例11: load

//Loads the settings for this Pane onto the SDL Surface.
func (me *Canvas) load() {
	me.viewport.calcBounds()
	r := toSDL_Rect(me.viewport.bounds())
	C.SDL_SetClipRect(me.pane, &r)
}
开发者ID:griffy,项目名称:starfish,代码行数:6,代码来源:canvas.go

示例12: setClipRect

// Sets the clipping rectangle for the destination surface in a blit.
//
// If the clip rectangle is NULL, clipping will be disabled.
// If the clip rectangle doesn't intersect the surface, the function will
// return SDL_FALSE and blits will be completely clipped.  Otherwise the
// function returns SDL_TRUE and blits to the surface will be clipped to
// the intersection of the surface area and the clipping rectangle.
//
// Note that blits are automatically clipped to the edges of the source
// and destination surfaces.
func setClipRect(surface *C.SDL_Surface, rect *C.SDL_Rect) bool {
	return i2b(int(C.SDL_SetClipRect(surface, rect)))
}
开发者ID:beoran,项目名称:fungo,代码行数:13,代码来源:video.go


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