當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。