restarting the IrrLicht Device

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

restarting the IrrLicht Device

Post 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)
a screen cap is worth 0x100000 DWORDS
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post 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.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post 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.
qwe
Posts: 112
Joined: Sun Dec 28, 2003 12:54 am
Location: Oregon, USA

Post 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
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post 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.
a screen cap is worth 0x100000 DWORDS
qwe
Posts: 112
Joined: Sun Dec 28, 2003 12:54 am
Location: Oregon, USA

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