Ejemplo n.º 1
0
func (win *Window) UpdateSurfaceRects(rects []Rect) error {
	if C.SDL_UpdateWindowSurfaceRects(win.c, (*C.SDL_Rect)(unsafe.Pointer(&rects[0])), C.int(len(rects))) != 0 {
		return getError()
	}

	return nil
}
Ejemplo n.º 2
0
Archivo: video.go Proyecto: salihdb/sdl
// UpdateRects copies a number of rectangles on the window surface to the
// screen.
//
// Note: A Surface must be associated with the window before calling this
// function.
func (win *Window) UpdateRects(rects []image.Rectangle) (err error) {
	cRects := C.makeRectArray(C.int(len(rects)))
	defer C.SDL_free(unsafe.Pointer(cRects))
	for index, rect := range rects {
		cRect := cRect(rect)
		C.setArrayRect(cRects, cRect, C.int(index))
	}
	if C.SDL_UpdateWindowSurfaceRects(win.cWin, cRects, C.int(len(rects))) != 0 {
		return getError()
	}
	return nil
}
Ejemplo n.º 3
0
func (window *Window) UpdateSurfaceRects(rects []Rect) int {
	_window := (*C.SDL_Window)(unsafe.Pointer(window))
	_rects := (*C.SDL_Rect)(unsafe.Pointer(&rects[0]))
	_numrects := (C.int)(len(rects))
	return (int)(C.SDL_UpdateWindowSurfaceRects(_window, _rects, _numrects))
}
Ejemplo n.º 4
0
// Window (https://wiki.libsdl.org/SDL_UpdateWindowSurfaceRects)
func (window *Window) UpdateSurfaceRects(rects []Rect) error {
	if C.SDL_UpdateWindowSurfaceRects(window.cptr(), rects[0].cptr(), C.int(len(rects))) != 0 {
		return GetError()
	}
	return nil
}
Ejemplo n.º 5
0
func (window *Window) UpdateSurfaceRects(rects []Rect) int {
	return int(C.SDL_UpdateWindowSurfaceRects(window.cptr(), rects[0].cptr(), C.int(len(rects))))
}