I have my Irrlicht scene embedded inside another window, via the external API. In addition to that, I have a static image (changed rarely) showing the scene from some other camera. This image is created by drawing the scene via a render-to-texture, and copying the data. This works pretty well.
However, sometimes I hide the irrlicht scene to show something else, but not the static image. But the static image can get refreshed even when the irrilcht scene is hidden. However, in that case the static image will always show the last scene rendered to it while the main irrlicht scene was shown.
For example, suppose I have two static images (cam1 and cam2) and I do the following:
1) Update cam1 image
2) Update cam2 image
3) Hide Irrlicht scene
4) Update cam1 image
5) Update cam2 image
Then both the static images for cam1 and cam2 will show the same thing, the image made in (2).
The scene is hidden (I looked at the widget library's code) via:
Code: Select all
XUnmapWindow()
Code: Select all
ICameraSceneNode *originalCamera=getSceneManager()->getActiveCamera();
originalCamera->grab();
getVideoDriver()->setRenderTarget(rt, true, true, color);
getSceneManager()->setActiveCamera ( cam );
getSceneManager()->drawAll();
getSceneManager()->setActiveCamera (originalCamera);
originalCamera->drop();
getVideoDriver()->setRenderTarget(0);
I won't be surprised if my use case isn't supported by Irrlicht, but I would appreciate it if people offered suggestions on how I could debug this.
Thank you.