Cleaning up device

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.
Post Reply
Elektordi
Posts: 4
Joined: Sun Oct 01, 2006 8:29 pm

Cleaning up device

Post by Elektordi »

Hello,

I'm working on a projet using Irrlicht and I have a problem:
I use the same device object during all the game: start screen, demo, UI, game, options...
The problem is that all objets persists ans I have to remove them before changing scene. But I sometimes "forget" one, sometimes because I can't have a valid pointer of all objets !
I've tried to browse the device class for all my elements and drop them. But the only thing I done is to crash the engine...

Is there a way to "clean up" or "reset" the device, to drop all created childs (gui, scene...), without closing the device and recreating a new one ?
Coolkat88
Posts: 30
Joined: Tue Oct 03, 2006 3:14 pm

Post by Coolkat88 »

there is a clear() function in the scene manager.

Code: Select all

device->getSceneManager()->clear();
this will clear all the scene nodes and everything that is in the buffer more or less.

i used this to clear the scene before changing to another scene. but the GUI environment doesn't have one and im currently working on a way to clear that.. if i find something i'll post it here.
Elektordi
Posts: 4
Joined: Sun Oct 01, 2006 8:29 pm

Post by Elektordi »

Really thanks...

For the GUI manager, I'm using a colection in which I store every element I create but I sometime miss some of them !
Post Reply