The idea is to have a window show up when the program is launched, where you can set the screen size, choose windowed or fullscreen, etc, then you click a play button and the game is launched with the selected settings.
So I start as usual:
Code: Select all
IrrlichtDevice* device = createDevice(EDT_OPENGL, dimension2d<u32>(512, 384));
device->setWindowCaption(L"Launcher");
IVideoDriver* driver = device->getVideoDriver();
while(device->run() && !exit)
{
/* do stuff and set exit when "Play" is clicked */
}
device->drop();
Code: Select all
device = createDevice(/* options blah */);
device->setWindowCaption(L"Game");
driver = device->getVideoDriver();
while(device->run())
{
/* play the game and do more stuff */
}
device->drop();
I tried using closeDevice before the first device->drop(). But the second window is also closed.
I also tried using a different device and driver objects, but it made no difference.
Can anyone help?
Is it at all possible what I want to do?
An alternative would be to change resolution, driver type, etc, after the device is created, but I'm pretty sure that is not possible.