本文整理汇总了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))
}
示例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)
}
示例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
}
示例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)
}
示例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()))
}
示例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
}
示例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))
}