Esempio n. 1
0
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()
}
Esempio n. 2
0
// 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
}
Esempio n. 3
0
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
}
Esempio n. 4
0
// Swaps screen buffers.
func (screen *Surface) Flip() int { return int(C.SDL_Flip((*C.SDL_Surface)(cast(screen)))) }
Esempio n. 5
0
// 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())
}
Esempio n. 6
0
// 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)
}