示例#1
0
文件: surface.go 项目: badgerodon/go
func (this Surface) UpdateRects(rects []Rect) {
	c_surface := (*C.SDL_Surface)(this.Ptr)
	c_numrects := C.int(len(rects))
	var c_rects *C.SDL_Rect
	if len(rects) > 0 {
		c_rects = (*C.SDL_Rect)(unsafe.Pointer(&rects[0]))
	}
	C.SDL_UpdateRects(c_surface, c_numrects, c_rects)
}
示例#2
0
文件: sdl.go 项目: kearsley/Go-SDL
func (screen *Surface) UpdateRects(rects []Rect) {
	if len(rects) > 0 {
		GlobalMutex.Lock()
		screen.mutex.Lock()

		C.SDL_UpdateRects(screen.cSurface, C.int(len(rects)), (*C.SDL_Rect)(cast(&rects[0])))

		screen.mutex.Unlock()
		GlobalMutex.Unlock()
	}
}
示例#3
0
文件: sdl.go 项目: gnanderson/Go-SDL
func (screen *Surface) UpdateRects(rects []Rect) {
	if len(rects) > 0 {
		C.SDL_UpdateRects((*C.SDL_Surface)(cast(screen)), C.int(len(rects)), (*C.SDL_Rect)(cast(&rects[0])))
	}
}