wasm-bindgen
wasm-bindgen copied to clipboard
Unable to invoke `AngleInstanceArrays::draw_arrays_instanced_angle`
Describe the Bug
Ambiguous documentation and failing execution of web_sys::AngleInstancedArrays
.
Steps to Reproduce
I have a Stackoverflow question here: https://stackoverflow.com/questions/72834638/how-to-invoke-rust-web-sys-angleinstancedarrays
I've enabled the AngleInstancedArrays in the web-sys.features in Cargo.toml.
I am able to access and invoke the function 'draw_arrays_instanced_angle', but it requires a reference to &self
as first argument, but there is no way (at least none documented or obvious) to instantiate an AngleInstanceArrays struct.
https://github.com/kulicuu/yew_webgl2_game/blob/master/src/components/game.rs#L151
web_sys::AngleInstancedArrays
is a JS structure in the browser, a handle is obtained with WebGl2RenderingContext.get_extension. So from web-sys
api not instantiated as an AngleInstanceArrays struct. Similar as this construct for WebGl2RenderingContext cast in game. The game source has a cast, which is missing for AngleInstancedArrays
. Have noted this on the SO question.