texImage2DfromAsset method
Future<void>
texImage2DfromAsset(
- int target,
- String assetPath, {
- int level = 0,
- int internalformat = WebGL.RGBA32UI,
- int format = WebGL.RGBA,
- 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();
}