-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples on asm.js #383
Comments
Yup, that's why it's not supported yet... 17-drawstress work. |
+1 vote for statics. |
@RichardGale Another problem is that resources have to be downloaded since there is no file system. Most of examples require some assets to be loaded. |
Latest emscripten could make this problem easier to solve than other platforms. If you add --preload-file [directory of resources] to emcc during finalization that entire directory is packed into a virtual file system that is automatically mounted by the Javascript. Then fopen() and other calls "just work". Any other known issues? |
That's cool, nope. I just need to create init/update/shutdown for all examples, instead main with while loop. |
Do you know did they fix setjmp/longjmp? Also if they add pthreads, that would also fix examples. |
I don't know the state of setjmp/longjmp as I stopped using them. pthreads are experimental (emscripten-core/emscripten-fastcomp#67). I took a look at drawstress and the transformation seemed:
|
If setjmp/longjmp works no change to will be necessary... It could be faked with it. |
I had this before, but it didn't work:
Then in while loop just call (and it should work with any example):
If this works, then I'll bury that |
State of play: Code that uses low-level features of the native environment, for example native stack manipulation in conjunction with setjmp/longjmp (we support normal setjmp/longjmp, but not with stack replacing, etc.) https://kripken.github.io/emscriptem-site/docs/porting/guidelines/portability_guidelines.html I'll try your code in my app. |
Integrated with example-00-helloworld and got: uncaught exception: longjmp |
This works, you just need to uncomment and rebuild: It's slow, but it can get you to other examples until I change them to have init/update/shutdown. |
I fixed a few examples to work with emscripten. |
Due to the use of
while(true)
, none of the examples work on asm.js.To suport
emscripten_set_main_loop
, all examples will have to be rewritten. The lack of a stack makes it quite troublesome. Local variables will have to become static or instance variables.The text was updated successfully, but these errors were encountered: