コード例 #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
ファイル: framebuffer.go プロジェクト: DrJosh9000/ebiten
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)
}