Page 4 of 4

Re: Emscripten port

Posted: Sat Aug 25, 2018 12:06 am
by denzelbro
createDevice is one of the startup functions so it looks like the irrlicht library for emscripten is not properly build or linked.

Re: Emscripten port

Posted: Mon Aug 27, 2018 8:12 pm
by lunariusis
Thanks, I will experiment with the compilation.

Re: Emscripten port

Posted: Fri Oct 25, 2019 1:14 pm
by netpipe

Re: Emscripten port

Posted: Sat Oct 26, 2019 4:38 pm
by netpipe
made setup very easy and enjoyable , was thinking about making a scripted app/game launcher also a custom webpage format that is animated and easy to make sites for. please message me if interested in helping.

Re: Emscripten port

Posted: Mon Nov 04, 2019 3:54 am
by netpipe

Re: Emscripten port

Posted: Fri Nov 08, 2019 6:12 pm
by netpipe
new demo added, the EMMath http://www.netpipe.ca/apps/math/test.html resulting wasm was 40 mb not sure what changed from the other demos

Re: Emscripten port

Posted: Mon Nov 18, 2019 6:23 am
by netpipe
i got the EmCPython compile working but when i add
-s EMULATE_FUNCTION_POINTER_CASTS=1 to irrlicht compile it says

FuncCastEmulation::NUM_PARAMS needs to be at least FuncCastEmulation::NUM_PARAMS needs to be at least 1717

https://i.imgur.com/wkgf8sD.png

Re: Emscripten port

Posted: Mon Nov 18, 2019 10:17 am
by CuteAlien
Can't say I remember any functions in Irrlicht with 1717 parameters :-)

Re: Emscripten port

Posted: Thu Nov 28, 2019 8:33 pm
by netpipe
https://i.imgur.com/46tehnn.png spark engine is working nicely

Re: Emscripten port

Posted: Fri Dec 13, 2019 4:32 am
by netpipe
https://github.com/netpipe/emscripten-projects a little collection of working libs for emscripten.

Re: Emscripten port

Posted: Wed Dec 18, 2019 4:25 am
by netpipe
also i have SDL_audio compiled and working for emscripten now http://netpipe.ca/apps/sam/Pong.html

Re: Emscripten port

Posted: Thu Dec 19, 2019 1:18 pm
by netpipe
was able to fix FuncCastEmulation::NUM_PARAMS needs to be at least FuncCastEmulation::NUM_PARAMS needs to be at least 1717 by using latest opengl-es branch of irrlicht.

Re: Emscripten port

Posted: Fri Aug 20, 2021 10:07 pm
by LunaRebirth
Not sure when this started happening as I'm on an entirely new PC now and don't have my old one, but Irrlicht is crashing on Emscripten when I remove an element that has children. Here's the stack trace:

Code: Select all

exception thrown: RuntimeError: memory access out of bounds,RuntimeError: memory access out of bounds
    at irr::IReferenceCounted::drop() const (http://127.0.0.1:8887/EmscriptenApp.wasm:wasm-function[486]:0x1b3f3)
    at irr::gui::CGUIImage::~CGUIImage() (http://127.0.0.1:8887/EmscriptenApp.wasm:wasm-function[21709]:0x805dc1)
    at irr::gui::CGUIImage::~CGUIImage().1 (http://127.0.0.1:8887/EmscriptenApp.wasm:wasm-function[21711]:0x805ea7)
    at irr::gui::CGUIImage::~CGUIImage().2 (http://127.0.0.1:8887/EmscriptenApp.wasm:wasm-function[21714]:0x806021)
    at virtual thunk to irr::gui::CGUIImage::~CGUIImage().3 (http://127.0.0.1:8887/EmscriptenApp.wasm:wasm-function[21716]:0x806108)
    at irr::IReferenceCounted::drop() const (http://127.0.0.1:8887/EmscriptenApp.wasm:wasm-function[486]:0x1b44f)
    at irr::gui::IGUIElement::removeChild(irr::gui::IGUIElement*) (http://127.0.0.1:8887/EmscriptenApp.wasm:wasm-function[560]:0x2253d)
    at irr::gui::IGUIElement::remove() (http://127.0.0.1:8887/EmscriptenApp.wasm:wasm-function[562]:0x2289b)
printErr @ EmscriptenApp.html:316
handleException @ EmscriptenApp.js:4320
callUserCallback @ EmscriptenApp.js:4444
runIter @ EmscriptenApp.js:4497
Browser_mainLoop_runner @ EmscriptenApp.js:4403
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
requestAnimationFrame (async)
requestAnimationFrame @ EmscriptenApp.js:4812
Browser_mainLoop_scheduler_rAF @ EmscriptenApp.js:4263
Browser_mainLoop_runner @ EmscriptenApp.js:4416
EmscriptenApp.js:4321 Uncaught RuntimeError: memory access out of bounds
    at irr::IReferenceCounted::drop() const (EmscriptenApp.wasm:0x1b3f3)
    at irr::gui::CGUIImage::~CGUIImage() (EmscriptenApp.wasm:0x805dc1)
    at irr::gui::CGUIImage::~CGUIImage().1 (EmscriptenApp.wasm:0x805ea7)
    at irr::gui::CGUIImage::~CGUIImage().2 (EmscriptenApp.wasm:0x806021)
    at virtual thunk to irr::gui::CGUIImage::~CGUIImage().3 (EmscriptenApp.wasm:0x806108)
    at irr::IReferenceCounted::drop() const (EmscriptenApp.wasm:0x1b44f)
    at irr::gui::IGUIElement::removeChild(irr::gui::IGUIElement*) (EmscriptenApp.wasm:0x2253d)
    at irr::gui::IGUIElement::remove() (EmscriptenApp.wasm:0x2289b)
Trying to debug it but I'm not entirely sure yet...

EDIT:

So I traced it all the way back to this code:

Code: Select all

ITexture* curTex = ((IGUIImage*)this->b)->getImage();
driver->removeTexture(curTex);
Once I'm done with an image I don't want it sitting in cached memory so I remove it. The webassembly apparently does not like this, but everything else is fine with it (Windows, Mac, Linux, Android, and iOS don't complain)