예제 #1
0
func (renderer *Renderer) ReadPixels(rect *Rect, format uint32, pixels unsafe.Pointer, pitch int) int {
	_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))
	_rect := (*C.SDL_Rect)(unsafe.Pointer(rect))
	_format := (C.Uint32)(format)
	_pitch := (C.int)(pitch)
	return (int)(C.SDL_RenderReadPixels(_renderer, _rect, _format, pixels, _pitch))
}
예제 #2
0
파일: render.go 프로젝트: emlai/go-sdl2
// Renderer (https://wiki.libsdl.org/SDL_RenderReadPixels)
func (renderer *Renderer) ReadPixels(rect *Rect, format uint32, pixels unsafe.Pointer, pitch int) error {
	_ret := C.SDL_RenderReadPixels(renderer.cptr(), rect.cptr(), C.Uint32(format), pixels, C.int(pitch))
	if _ret < 0 {
		return GetError()
	}
	return nil
}
예제 #3
0
파일: render.go 프로젝트: JalfResi/go-sdl2
func (renderer *Renderer) ReadPixels(rect *Rect, format uint32, pixels unsafe.Pointer, pitch int) int {
	return int(C.SDL_RenderReadPixels(renderer.cptr(), rect.cptr(), C.Uint32(format), pixels, C.int(pitch)))
}