Buffer:newBlob
EditDownloads the Buffer's data from VRAM and returns it as a Blob. This is similar to Buffer:getData, but returns a Blob instead of a table.
blob = Buffer:newBlob(offset, extent)Arguments
| Name | Type | Default | Description |
| offset | number | 0 | An offset in the Buffer to read from, in bytes. |
| extent | number | nil | The number of bytes to read. If nil, reads the remainder of the buffer. |
Returns
| Name | Type | Description |
| blob | Blob | A new Blob with the Buffer's data. |
Notes
This function is very slow, because it stalls the CPU until the data has finished downloading from the GPU. The stall can be avoided be calling this function in a task, which will put the task to sleep until the data is ready. See lovr.task for more details.