Skip to content

Is there a way to initialize WGPU with HTMLCanvas/WebGlRenderingContext? #2893

Answered by grovesNL
Umenokin asked this question in Q&A

You must be logged in to vote

Hi @Umenokin! 👋

You should be able to pass a WebGlRenderingContext using instance.create_surface_from_canvas

pub fn create_surface_from_canvas(&self, canvas: &web_sys::HtmlCanvasElement) -> Surface {
when you're using the wasm target.

Replies: 3 comments 8 replies

You must be logged in to vote
1 reply
@Umenokin

Answer selected by Umenokin

You must be logged in to vote
0 replies

You must be logged in to vote
7 replies
@KySpace

@cwfitzgerald

@KySpace

@KySpace

@KySpace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
8 participants