當前位置: 首頁>>代碼示例>>Golang>>正文


Golang C.SDL_UpperBlit函數代碼示例

本文整理匯總了Golang中C.SDL_UpperBlit函數的典型用法代碼示例。如果您正苦於以下問題:Golang SDL_UpperBlit函數的具體用法?Golang SDL_UpperBlit怎麽用?Golang SDL_UpperBlit使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了SDL_UpperBlit函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: UpperBlit

func (src *Surface) UpperBlit(srcrect *Rect, dst *Surface, dstrect *Rect) int {
	_src := (*C.SDL_Surface)(unsafe.Pointer(src))
	_srcrect := (*C.SDL_Rect)(unsafe.Pointer(srcrect))
	_dst := (*C.SDL_Surface)(unsafe.Pointer(dst))
	_dstrect := (*C.SDL_Rect)(unsafe.Pointer(dstrect))
	return (int)(C.SDL_UpperBlit(_src, _srcrect, _dst, _dstrect))
}
開發者ID:kyleconroy,項目名稱:golds,代碼行數:7,代碼來源:sdl_surface.go

示例2: Blit

func (dst *Surface) Blit(dstrect *Rect, src *Surface, srcrect *Rect) int {
	GlobalMutex.Lock()
	global := true
	if (src != currentVideoSurface) && (dst != currentVideoSurface) {
		GlobalMutex.Unlock()
		global = false
	}

	// At this point: GlobalMutex is locked only if at least one of 'src' or 'dst'
	//                was identical to 'currentVideoSurface'

	var ret C.int
	{
		src.mutex.RLock()
		dst.mutex.Lock()

		ret = C.SDL_UpperBlit(
			src.cSurface,
			(*C.SDL_Rect)(cast(srcrect)),
			dst.cSurface,
			(*C.SDL_Rect)(cast(dstrect)))

		dst.mutex.Unlock()
		src.mutex.RUnlock()
	}

	if global {
		GlobalMutex.Unlock()
	}

	return int(ret)
}
開發者ID:kearsley,項目名稱:Go-SDL,代碼行數:32,代碼來源:sdl.go

示例3: UpperBlit

func (s *Surface) UpperBlit(sr *Rect, dst *Surface, dr *Rect) error {
	if C.SDL_UpperBlit(s.c(), sr.c(), dst.c(), dr.c()) != 0 {
		return getError()
	}

	return nil
}
開發者ID:willemvds,項目名稱:sdl,代碼行數:7,代碼來源:surface.go

示例4: Blit

func (dst *Surface) Blit(dstrect *Rect, src *Surface, srcrect *Rect) int {
	var ret = C.SDL_UpperBlit(
		(*C.SDL_Surface)(cast(src)),
		(*C.SDL_Rect)(cast(srcrect)),
		(*C.SDL_Surface)(cast(dst)),
		(*C.SDL_Rect)(cast(dstrect)))

	return int(ret)
}
開發者ID:gnanderson,項目名稱:Go-SDL,代碼行數:9,代碼來源:sdl.go

示例5: UpperBlit

func (src *Surface) UpperBlit(srcRect *Rect, dst *Surface, dstRect *Rect) int {
	return int(C.SDL_UpperBlit(src.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()))
}
開發者ID:JalfResi,項目名稱:go-sdl2,代碼行數:3,代碼來源:surface.go

示例6: UpperBlit

// Surface (https://wiki.libsdl.org/SDL_UpperBlit)
func (src *Surface) UpperBlit(srcRect *Rect, dst *Surface, dstRect *Rect) error {
	if C.SDL_UpperBlit(src.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {
		return GetError()
	}
	return nil
}
開發者ID:emlai,項目名稱:go-sdl2,代碼行數:7,代碼來源:surface.go

示例7: blitSurface

// You should call SDL_BlitSurface() unless you know exactly how SDL
// blitting works internally and how to use the other blit functions.
func blitSurface(src, dst *C.SDL_Surface, srcrect, dstrect *C.SDL_Rect) int {
	return int(C.SDL_UpperBlit(src, srcrect, dst, dstrect))
}
開發者ID:beoran,項目名稱:fungo,代碼行數:5,代碼來源:video.go


注:本文中的C.SDL_UpperBlit函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。