Emscripten port

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
denzelbro
Posts: 50
Joined: Wed Jun 27, 2018 11:53 pm

Re: Emscripten port

Post by denzelbro »

createDevice is one of the startup functions so it looks like the irrlicht library for emscripten is not properly build or linked.
lunariusis
Posts: 2
Joined: Fri Aug 24, 2018 11:34 pm

Re: Emscripten port

Post by lunariusis »

Thanks, I will experiment with the compilation.
netpipe
Posts: 669
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: Emscripten port

Post by netpipe »

Last edited by netpipe on Fri May 29, 2020 10:12 pm, edited 2 times in total.
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
netpipe
Posts: 669
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: Emscripten port

Post 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.
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
netpipe
Posts: 669
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: Emscripten port

Post by netpipe »

Last edited by netpipe on Sun May 31, 2020 4:52 pm, edited 3 times in total.
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
netpipe
Posts: 669
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: Emscripten port

Post 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
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
netpipe
Posts: 669
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: Emscripten port

Post 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
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
CuteAlien
Admin
Posts: 9643
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Emscripten port

Post by CuteAlien »

Can't say I remember any functions in Irrlicht with 1717 parameters :-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
netpipe
Posts: 669
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: Emscripten port

Post by netpipe »

https://i.imgur.com/46tehnn.png spark engine is working nicely
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
netpipe
Posts: 669
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: Emscripten port

Post by netpipe »

https://github.com/netpipe/emscripten-projects a little collection of working libs for emscripten.
Last edited by netpipe on Fri May 29, 2020 10:26 pm, edited 1 time in total.
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
netpipe
Posts: 669
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: Emscripten port

Post by netpipe »

also i have SDL_audio compiled and working for emscripten now http://netpipe.ca/apps/sam/Pong.html
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
netpipe
Posts: 669
Joined: Fri Jun 06, 2008 12:50 pm
Location: Edmonton, Alberta, Canada
Contact:

Re: Emscripten port

Post 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.
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
LunaRebirth
Posts: 386
Joined: Sun May 11, 2014 12:13 am

Re: Emscripten port

Post 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)
Post Reply