WebAssembly and usability
kariem2k opened this issue · 3 comments
Thank you for this great framework. I have two questions:
- If you want to try to compile rizz to webassembly/asm.js, do you see problems arising from that? like will co-routines, the virtual file system, and the async loading work?
- Is the 2dtools usable, or it has major missing features?
Thanks
Hi,
-
I've been thinking about porting to emscripten for some time, but never had the time nor the use case for it up to now. yes, aside from he issues you mentioned, it shouldn't have any other problems running on that platform, as it has support for OpenGL-ES2. so basically, from the top of my head, we need to fix:
- co-routines (not a big deal since no engine system depends on it)
- vfs: should use a workaround for async file loading instead of threads
- task manager: this too can be probably be skipped by cutting it out from asset-manager (only use sync loading)
- plugin system should probably be used in BUNDLE mode and ditch the whole dynamic loading/hot-reload feature
- hot-reload in vfs should be turned off
- some plugins that work with platform APIs (sound/input) and rendering code needs fixing obviously, but they are plugins so we could do them at later stage
If you want to take initiation on this, please do. Any PRs are very welcomed and I will give any assistance I could.
-
It depends on what u want. see examples 03-drawsprite, 04-animsprite and rizz-space-invaders repo. they all use 2dtools sprite/font API. but of course there are some missing features and possible bugs. see here and here for some of them
Thanks septag for all of this info.
I am currently evaluating frameworks. I really like rizz because it provides low level stuff that can get you going quickly without limiting you. WebGL is one of our major platform targets, so if we continue with rizz and we are in a point that we need webgl support, I can definitely try to port it to webasm. For corountines we can use https://github.com/edubart/minicoro from the beginning instead of rizz's because it supports webasm. Yeah I think the major change is the assets and the vfs.
thanks for the nice comments and suggestions.
I've checked out the code , it's nice to see that emscripten has native API for that. I'll probably try to add that to my base lib (sx)
take care