My device renders to a windows form (well a "Panel" control). This works great.
But in my application, the control is parented to a "dockable" control and when I tear this dockable control off from the main UI, the window ID of the control changes. This means that the viewport now just gets rendered the default colour, Irrlicht no longer renders to it. This makes perfect sense, but my question is, how do I change the Irrlicht device to point to the new window ID?
If I create a new device, then I need to somehow re-create all the scene nodes that were in the original SceneManager - unless there is a way to create a device using an existing SceneManager?
Any advice or help on how to solve this problem would be great. Ideally the dockable control wouldn't change its window ID, but unfortunately that one is completely out of my ability to control (I think).
Changing a device's WindowId?
Re: Changing a device's WindowId?
I never tried this myself, but there is SExposedVideoData which you can access either from IVideoDriver or pass as parameter to beginScene. One of the values it contains is the HWND - so you might trying setting the new one there.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 2
- Joined: Tue Oct 07, 2014 2:19 am
Re: Changing a device's WindowId?
Perfect!
Thanks, I hadn't seen that. Both of these work perfectly.
Thanks, I hadn't seen that. Both of these work perfectly.