Open trusktr opened 7 years ago
It might help to know: what can I do, and what can't I do?
I've been wondering something similar myself; if you search for *glfw*
in the Emscripten installation, you find quite a bunch of related files, such as library_glfw.js
. AFAICT most of the "magic" happens in there.
Does that mean that we have to use glfw if we want to compile GL-capable programs to the web using Emscripten?
For example, what if there's some C++ game engine written using something other than glfw? Will it involve having to refactor it to use glfw?
AFAICT yes, only GLFW for now. Support for other GL frameworks would require writing a new emscripten wrapper first.
There's not a lot of code in here. How does the emscripten compile process know how to translate glfw window-creating calls to some sort of canvas output? In other words, how does emscripten know to translate cross-platform window-making calls into some sort of rectangles within the application? Seems like pure magic. Or does Emscripten have to explicitly support glfw before glfw cpuld be used, so that it can map calls to some DOM calls?
And the GL calls? Does it only work with gles, and emscripten knows how to translate to WebGL calls?