emscripten-core / emscripten-core/emscripten

How to initialize WebGL2 Context with OffscreenCanvas

Open
#20,172 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

I'm going to do some work in a web worker so that I can not have a `canvas` element on the DOM tree. However, `emscripten_webgl_create_context` api requires an id attached to a canvas in the DOM tree. I know I can create a canvas object by `document.createElement('canvas')` then transfer this canvas to offscreen. But still, how can I pass this offscreen canvas context to wasm?

In a nutshell, how can I create a WebGL2RenderingContext with emscripten ?

Thanks a lot for your patience.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.