texImage2DfromAsset method

Future<void> texImage2DfromAsset(
  1. int target,
  2. String assetPath, {
  3. int level = 0,
  4. int internalformat = WebGL.RGBA32UI,
  5. int format = WebGL.RGBA,
  6. int type = WebGL.UNSIGNED_INT,
})

Implementation

Future<void> texImage2DfromAsset(
  int target,
  String assetPath, {
  int level = 0,
  int internalformat = WebGL.RGBA32UI,
  int format = WebGL.RGBA,
  int type = WebGL.UNSIGNED_INT,
}) async {
  final image = await loadImageFromAsset(assetPath);
  Uint8Array submit = Uint8Array.fromList((await image.toByteData())!.buffer.asUint8List());
  texImage2D(target, level, internalformat, image.width, image.height, 0, format, type, submit);
  submit.dispose();
}