PDA

View Full Version : Update backing store with screen content for direct rendering



Tobias
5th November 2010, 17:46
Hello,

I got the following window update problem using QT version 4.5:
To avoid flickering caused by multiple updates and changing subwindows I am hiding the central widget of my mainframe window while updates are done and show it again when updates are done. This works well so far.
The problem is that one of my subwindows is a 3D window (derived from QGLwidget). So when I run my program on a workstation with a graphics card that is using direct rendering (renders directly to screen), during the update period 3D window area is not updated correctly (the last scene that was shown before the 3D window was activated in this area is shown). I think that the reason for this problem is that the QT backing store is shown as long as the central widget is hidden (calling function d_func()->syncBackingStore()) -> This of course does not work for the 3D window for which backing store was never updated.

I already tried to solve the problem by simply deactivating the direct rendering for the 3D window. This is not really a solution for me as rendering gets too slow for this case.

So I tried to get the currently shown scene from screen (by making a screenshot of 3D window area) and writing it back to backing store before starting the windows update stop.
My problem is that I don't know how to access the backing store correctly.
I tried to simply draw 3D scene over 3D window in an other window that is shown for a short time. This works but I still get a short flicker when this window is activated as then the last active backing store is shown once.
(Calling setUpdatesEnabled(false) does not work to avoid updates when windows
are moved or hidden/shown).

I would be really happy if anyone could tell me how to get a direct access on the system's backing store so that I can update it correctly with current screen content or if someone can show me a way how to synchronize backing store and screen in another way.