예제 #1
0
파일: image.go 프로젝트: carriercomm/ebiten
func (i *Image) Pixels(context *opengl.Context) ([]uint8, error) {
	// Flush the enqueued commands so that pixels are certainly read.
	if err := theCommandQueue.Flush(context); err != nil {
		return nil, err
	}
	f := i.framebuffer
	return context.FramebufferPixels(f.native, f.width, f.height)
}
예제 #2
0
func (f *Framebuffer) Pixels(c *opengl.Context) ([]uint8, error) {
	w, h := f.Size()
	w, h = NextPowerOf2Int(w), NextPowerOf2Int(h)
	return c.FramebufferPixels(f.native, w, h)
}