Page 1 of 1

Creating device, shutting it down and creating a new problem

Posted: Wed Feb 27, 2008 12:56 pm
by Godai
Hi. I'm new to using Irrlicht, but an experienced game/engine programmer, and so far it's an excellent, fast engine. However.

I create a device using the burning software render the first time to allow the user to select device, effects, screen etc. options.
If I call drop on the first device, and then create the second you can still see the first device window.
Ok. Fair enough. I call closedevice on the first device, (which states that run will fail for the current device) and now the first device window is closed, but the second device created, bails out when run is called.
It seems like a bug, since i closed a completely different device?

As I'm a new Irrlicht user I might be missing something, so any help would be greatly appreciated :)

Thanks in advance

Posted: Wed Feb 27, 2008 2:41 pm
by JP
Maybe you're doing something weird with the pointers, post the code where you do the device stuff :)

Posted: Wed Feb 27, 2008 5:14 pm
by hybrid
There's still this annoying win32 device problem where a close device event might stay in the event queue and kill the second device. I think you have to call device->run() once more before dropping the old device and creating the new one to avoid this. But post your code, will help.

Posted: Sat Mar 01, 2008 1:01 am
by trivtn
I'm success in my project like this :
///////
IrrlichtDevice* device =createDevice( video::EDT_BURNINGSVIDEO, dimension2d<s32>(640,480), 32,false, false, false, &Event);
int mdevice;
dimension2di win;
bool fullscreen;
...
while (device->run())
{
// support user select devicetype, win, fullscreen...
...
}
device->drop();
//create new device by user select
device =createDevice( mdevice, win, 32,fullscreen,...);
...
while (device->run())
{
// support user select dirver, fullscreen...
...
}
device->drop();

Posted: Sat Mar 01, 2008 1:47 am
by TheBeef
For your first device, name it something like 'tempDevice', and then leave your actual device as 'device' - maybe something's going on with the naming.

I'm just guessing, though.