I recently ported big C++ application into webassembly and the only issue I 
have so far is filesystem's .data file size.
What I need is to load some resources only on request (fopen call or 
something similar) from the C++ code, but I can't change all places in C++ 
code where files are opened to make them use asynchronous load or some JS 
code.

What I've found is that there is FS.createLazyFile, but it works only in 
web worker. I tried dumb approach with moving whole generated .js file into 
worker and it fails with "ReferenceError: screen is not defined". As far as 
I understand my whole app can't be moved into web worker, because it does 
rendering. (note: I'm newbie in the web and js related stuff and might be 
missing something simple)

So my questions are:
- is it possible to load resources on demand without changing the C++ code 
that opens files? I'm ok with making main thread/render stop while it is 
loading.
- if first is not possible could it be possible to add files into 
filesystem after the app was started, from the C++ code? All files, that 
need to be added are located near the .html .js and other files.

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/211bc424-9c5b-4d3d-b8fd-a2267201e77d%40googlegroups.com.

Reply via email to