error[E0599]: no method named create_surface_from_canvas found for struct wgpu::Instance in the current scope
--> src\lib.rs:41:28
|
41 | let surface = instance.create_surface_from_canvas(&canvas);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: there is a method create_surface with a similar name
|
41 | let surface = instance.create_surface(&canvas);
| ~~~~~~~~~~~~~~
but this method is public according the documentation in repo
What you're looking at is an api from our internal abstraction layer wgpu-hal. Quite a few versions ago we did have individual entry points, which is what that changelog hit was referring to.
You can pass a HtmlCanvasElement to SurfaceTarget and pass that to Instance::create_surface. Note you need to switch docs.rs's platform to wasm to see the canvas and offscreen canvas variant.