예제 #1
0
파일: window.go 프로젝트: rdterner/exp
func (w *windowImpl) Upload(dp image.Point, src screen.Buffer, sr image.Rectangle, sender screen.Sender) {
	// TODO: adjust if dp is outside dst bounds, or sr is outside src bounds.
	// TODO: keep a texture around for this purpose?
	t, err := w.s.NewTexture(sr.Size())
	if err != nil {
		panic(err)
	}
	t.(*textureImpl).upload(dp, src, sr)
	if sender != nil {
		sender.Send(screen.UploadedEvent{Buffer: src, Uploader: w})
	}
	w.Draw(f64.Aff3{
		1, 0, float64(dp.X),
		0, 1, float64(dp.Y),
	}, t, sr, draw.Src, nil)
	t.Release()
}
예제 #2
0
파일: texture.go 프로젝트: rdterner/exp
func (t *textureImpl) Upload(dp image.Point, src screen.Buffer, sr image.Rectangle, sender screen.Sender) {
	t.upload(dp, src, sr)
	if sender != nil {
		sender.Send(screen.UploadedEvent{Buffer: src, Uploader: t})
	}
}