texImage2DfromAsset method
Future<void>
texImage2DfromAsset(
- int target,
- String asset, {
- int level = 0,
- int internalformat = WebGL.RGBA,
- int format = WebGL.RGBA,
- int type = WebGL.UNSIGNED_BYTE,
})
Implementation
Future<void> texImage2DfromAsset(
int target,
String asset, {
int level = 0,
int internalformat = WebGL.RGBA,
int format = WebGL.RGBA,
int type = WebGL.UNSIGNED_BYTE,
}) async {
final completer = Completer<void>();
final imageDom = html.ImageElement();
imageDom.crossOrigin = "";
imageDom.src = asset;
imageDom.onLoad.listen((e) {
texImage2D_NOSIZE(target, level, internalformat, format, type, imageDom);
completer.complete();
});
return completer.future;
}