rlCopyFramebuffer method
Copy framebuffer pixel data to internal buffer
Implementation
Uint8List rlCopyFramebuffer(
num x,
num y,
num width,
num height,
PixelFormat format,
) => run(
() => _debugLabels.rlCopyFramebuffer(x, y, width, height, format),
() {
final size = _coreDart.GetPixelDataSize(width, height, format);
if (size <= 0) {
throw ArgumentError(
'rlCopyFramebuffer: invalid pixel data size for '
'${width}x$height @ $format',
);
}
final pixels = $.Uint8$.Sized(size);
_flat.rlCopyFramebuffer(
x.toInt(),
y.toInt(),
width.toInt(),
height.toInt(),
format.value,
pixels.cast(),
);
return pixels.asCopy(size);
},
);