本文整理汇总了Golang中C.SDL_Flip函数的典型用法代码示例。如果您正苦于以下问题:Golang SDL_Flip函数的具体用法?Golang SDL_Flip怎么用?Golang SDL_Flip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SDL_Flip函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Flip
func (this Surface) Flip() error {
c_surface := (*C.SDL_Surface)(this.Ptr)
ret := C.SDL_Flip(c_surface)
if ret == 0 {
return nil
}
return GetError()
}
示例2: Flip
// Swaps screen buffers.
func (screen *Surface) Flip() int {
GlobalMutex.Lock()
screen.mutex.Lock()
status := int(C.SDL_Flip(screen.cSurface))
screen.mutex.Unlock()
GlobalMutex.Unlock()
return status
}
示例3: MainIteration
func MainIteration() (quit bool) {
select {
case <-kill:
quit = true
default:
for _, a := range drawers {
a.canvas.pane = screen
a.canvas.load()
a.drawer.Draw(&a.canvas)
}
C.SDL_Flip(screen)
}
time.Sleep(16000000)
quit = false
return
}
示例4: Flip
// Swaps screen buffers.
func (screen *Surface) Flip() int { return int(C.SDL_Flip((*C.SDL_Surface)(cast(screen)))) }
示例5: Flip
// Flip swaps screen buffers with a double-buffered display mode. Use it to
// make the changes you made to the screen become visible.
func Flip() {
mutex.Lock()
defer mutex.Unlock()
C.SDL_Flip(C.SDL_GetVideoSurface())
}
示例6: flip
// On hardware that supports double-buffering, this function sets up a flip
// and returns. The hardware will wait for vertical retrace, and then swap
// video buffers before the next video surface blit or lock will return.
// On hardware that doesn not support double-buffering, this is equivalent
// to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
// The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
// setting the video mode for this function to perform hardware flipping.
// This function returns 0 if successful, or -1 if there was an error.
func flip(screen *C.SDL_Surface) {
C.SDL_Flip(screen)
}