readCurrentPixels method
Implementation
Uint8List readCurrentPixels(int x, int y, int width, int height) {
int _len = width * height * 4;
Pointer<Uint8> ptr = malloc.allocate<Uint8>(sizeOf<Uint8>() * _len);
gl.glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, ptr);
final res = ptr.asTypedList(_len);
calloc.free(ptr);
return res;
}