texImage2DfromImage method

Future<void> texImage2DfromImage(
  1. int target,
  2. Image image, {
  3. int level = 0,
  4. int internalformat = WebGL.RGBA,
  5. int format = WebGL.RGBA,
  6. int type = WebGL.UNSIGNED_BYTE,
})

Implementation

Future<void> texImage2DfromImage(
  int target,
  Image image, {
  int level = 0,
  int internalformat = WebGL.RGBA,
  int format = WebGL.RGBA,
  int type = WebGL.UNSIGNED_BYTE,
}) async {
  Uint8Array submit = Uint8Array.fromList((await image.toByteData())!.buffer.asUint8List());
  texImage2D(target, level, internalformat, image.width, image.height, 0, format, type, submit);
  submit.dispose();
}