Hello
I'd like to know some information about the recreation of a device. If you want to change any of parameters which were given on device creation (like window size, device type ect.) you actually have to recreate the device.
Although the recreation doesn't seem so scary, the part I'm worrying about is the data that was stored within - all the scene data gui data and so on is lost if I understand it correctly.
So my question is: Is it somehow possible to 'copy' already uploaded data from one device to the recreated one. That is important if for example player wants to adjust his video settings (IN-game) because his game lags and he would have to wait for the data to be re-uploaded.
Thanks in advance.
Device recreation
Re: Device recreation
All those points are well supported by Irrlicht.
Use:-
device->setResizable( true ); // Window is resizeable. Note: This must be called otherwise 3D does not track MFC window
Then you can call this, when the window size changes:-
const core::dimension2d<u32> screensize = core::dimension2d<u32>( cxv, cy );
pDriver->OnResize( screensize );
You´ll also have to reset the aspect ration if that has changed.
As to "data" loaded, there is extensive support for node serialisation, so no problems there.
Follow the examples given and everything will usually go well.
Use:-
device->setResizable( true ); // Window is resizeable. Note: This must be called otherwise 3D does not track MFC window
Then you can call this, when the window size changes:-
const core::dimension2d<u32> screensize = core::dimension2d<u32>( cxv, cy );
pDriver->OnResize( screensize );
You´ll also have to reset the aspect ration if that has changed.
As to "data" loaded, there is extensive support for node serialisation, so no problems there.
Follow the examples given and everything will usually go well.
Re: Device recreation
Thanks for the serialization hint I will look up more info about this.
Although for other parameters (except window size ) for example toggling fullscreen mode I assume the device recreation is a must.
Although for other parameters (except window size ) for example toggling fullscreen mode I assume the device recreation is a must.
Re: Device recreation
You can change and position the irrlicht device window quite easily, including to go full-screen, or multiscreen. You can even create split views, like a quad view, and position it across 4 monitors; its really very flexible and irrlicht code is very clean and efficient.
Take your time though, there is a lot to see!
Take your time though, there is a lot to see!
Re: Device recreation
Hi,
sorry to bump this thread, but i'm very interested in changing the video settings without re-creating the irrlicht device. Thanks for the pointer
to the OnResize() method, i wouldn't have used it since the API Doc says: "Only used by the engine internally." But when testing it, i noticed it
only changes the "internal" resolution, but not the actual window size of the irrlicht application. Is this possible without re-creating the irrlicht device?
And could you give me a hint how to toggle fullscreen dynamically? I didn't find any method like "setFullscreen(bool)" in the VideoDriver.
Thanks a lot
Andreas
sorry to bump this thread, but i'm very interested in changing the video settings without re-creating the irrlicht device. Thanks for the pointer
to the OnResize() method, i wouldn't have used it since the API Doc says: "Only used by the engine internally." But when testing it, i noticed it
only changes the "internal" resolution, but not the actual window size of the irrlicht application. Is this possible without re-creating the irrlicht device?
And could you give me a hint how to toggle fullscreen dynamically? I didn't find any method like "setFullscreen(bool)" in the VideoDriver.
Thanks a lot
Andreas
Re: Device recreation
After a bit of searching I found this old post. (hopefully nothing changed in Irrlicht 1.8 )
http://irrlicht.sourceforge.net/forum/v ... hp?t=43379
As stated there basically you have to recreate the device if you want to change any of the initial parameters...
http://irrlicht.sourceforge.net/forum/v ... hp?t=43379
As stated there basically you have to recreate the device if you want to change any of the initial parameters...
Re: Device recreation
Thanks for the clarification, i obviously misunderstood robmar's reply.