Beispiel #1
0
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)
}
Beispiel #2
0
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()
	}
}
Beispiel #3
0
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])))
	}
}