Ejemplo n.º 1
0
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, err := i.createFramebufferIfNeeded(context)
	if err != nil {
		return nil, err
	}
	return context.FramebufferPixels(f.native, i.width, i.height)
}