Changing a device's WindowId?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
macaronikazoo
Posts: 2
Joined: Tue Oct 07, 2014 2:19 am

Changing a device's WindowId?

Post by macaronikazoo »

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).
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Changing a device's WindowId?

Post by CuteAlien »

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
macaronikazoo
Posts: 2
Joined: Tue Oct 07, 2014 2:19 am

Re: Changing a device's WindowId?

Post by macaronikazoo »

Perfect!

Thanks, I hadn't seen that. Both of these work perfectly.
Post Reply