Page 1 of 1

restarting the IrrLicht Device

Posted: Fri Jan 09, 2004 4:26 am
by keless
does destroying and then restarting the IrrLicht Device cause GUI items to be invalidated? what about Textures/Meshes?

I am thinking about adding to my ICE framework a screen to choose your device type/color depth/resolution. Im wondering if I have to make it only available as an initial state, or if I can restart the device at any time without worrying about invalidating the current state's loaded data. (especially since for GUI items, I use static pointers, and dont destroy them between states right now.. though I could change that if neccesary)

Posted: Fri Jan 09, 2004 4:48 am
by Boogle
I suspect it invalidates them, by default. You'd have to make sure everything you want to keep is grab()'ed, then add it to the new scene.

That's the way I see it anyway. Perhaps Niko knows of a better way, or perhaps he can add functionality to switch display modes (between fullscreen and windowed, in addition mode changes as you mentioned) without having to destroy the base Irrlicht instance.

Posted: Fri Jan 09, 2004 7:40 am
by niko
That's right, every createDevice() starts without scene, textures and so on. I think Boogle's idea is good, a new method in the IVideoDriver for swicthing the current displaymode would be useful.

Posted: Fri Jan 09, 2004 3:37 pm
by qwe
the only other way to do it would save the state of the engine to a temporary file, then restore it on engine restart :P

Posted: Fri Jan 09, 2004 4:23 pm
by keless
well, you cant really save the state of pointers or anything. and it would take a lot of code to automate keeping track of that and automatically unloading and re-loading the correct resources. I think i'll just make sure that any game-breaking changes can only happen before the game starts.

Posted: Fri Jan 09, 2004 6:09 pm
by qwe
true. But I meant more like in-game variables and whatnot. I would think the pointer initializations(device, driver, scene manager, models, textures, etc.) would be in their own separate function.