What is happening when an .irr scene file is loading?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: What is happening when an .irr scene file is loading?

Post by Cube_ »

You can't create a device when you already have a device, and you can't refresh the screen when still loading files, only between loading - if you want that you might want a 3rd party library like assimp (note: getting it to play nicely with irrlicht is an entirely unrelated question).

The easiest way to do it is to manage the loading screen externally from irrlicht, or display a static loading screen (this is what I do - works marvels)
"this is not the bottleneck you are looking for"
CuteAlien
Admin
Posts: 9633
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: What is happening when an .irr scene file is loading?

Post by CuteAlien »

You can update stuff as the log message is send immediately. Even if it's somewhat of a hack.
And I also think it's the reason MartinVee mentioned - you probably have beginScene running already at that point.
And you don't need to create a statictext element each time - you only need on - which you can change with setText.

But as first test- use just printf. If that doesn't update on each texture then it doesn't work anyway. Or use a debugger.
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
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: What is happening when an .irr scene file is loading?

Post by MartinVee »

I'm hesitant to post this, because it caused so many problems for us... but maybe you can make it work correctly. Be aware, though, that I'm actively working to replace this. I'm just not sure if the problems are with the actual method, or with the flaky implementation. So here goes...

We inherited a codebase that was creating a thread while loading the resources with the main thread. This secondary thread was creating it's own IrrlichtDevice but used the software renderer (since the OpenGL and DirectX drivers aren't thread-safe). The new software-rendered window was displayed on top of the main window, and was showing a loading screen animation. Once the main thread finished with the loading, it signaled the thread which then ended gracefully.

I can't really show you code for that as the implementation is flaky (I wish to stay polite), so I'll leave it as an exercise to the reader. I'm still not convinced this is a good way of using Irrlicht.
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: What is happening when an .irr scene file is loading?

Post by Cube_ »

MartinVee wrote:I can't really show you code for that as the implementation is flaky (I wish to stay polite), so I'll leave it as an exercise to the reader. I'm still not convinced this is a good way of using Irrlicht.
You'd be correct, it's not a good way the way irrlicht is written - if I ever finish my thread-safe patch I might release it (that is, if it's any good - otherwise it goes in the bin) but irrlicht as-is... well it's not a brilliant idea unless used very carefully.
"this is not the bottleneck you are looking for"
Post Reply