love.graphics.readbackBuffer

Available since LÖVE 12.0
This function is not supported in earlier versions.

Generates or updates ByteData from the contents of the given GraphicsBuffer.


Unlike love.graphics.readbackBufferAsync, this will not finish and return until the GPU completes its own asynchronous work which may take a frame's worth of time or more.


O.png This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use this while the game is interactive instead of loading, consider love.graphics.readbackBufferAsync instead.  


Function

Synopsis

data = love.graphics.readbackBuffer( buffer, offset, size, dest, destoffset )

Arguments

GraphicsBuffer buffer
The Buffer to read from.
number offset (0)
Optional offset in bytes from the start of the Buffer to read from.
number size (all)
Optional number of bytes to read. The entire contents until the end of the Buffer will be read if no size is given.
ByteData dest (nil)
Optional existing ByteData to fill instead of generating a new one.
number destoffset (0)
Optional offset in bytes from the start of the dest ByteData to copy into.

Returns

ByteData data
The new ByteData made from the Buffer's contents, or the updated existing ByteData if one was given.

See Also


Other Languages