Creating device, shutting it down and creating a new problem

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
Godai
Posts: 1
Joined: Tue Feb 26, 2008 3:29 pm

Creating device, shutting it down and creating a new problem

Post 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
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Maybe you're doing something weird with the pointers, post the code where you do the device stuff :)
Image Image Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
trivtn
Posts: 132
Joined: Tue Jan 17, 2006 12:30 pm
Location: Viet Nam
Contact:

Post 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();
There's something is fantastic, there's nothing is absolute.
TheBeef
Posts: 25
Joined: Wed Feb 20, 2008 4:38 am

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