Swapping buffers on multiple drawables

I am working for a video conference company, and despite my suggestions to the contrary, a few months ago my boss chose Gtkmm for a windowing/widget library for use in a new product. The video is to be displayed in gtkglext/OpenGL widgets. There is one main screen and a number of small thumbnails. The problem that I have run into is the fact that each of these calls the gtkglext swap_buffers call, which almost directly calls glXSwapBuffers. The problem I am having is that the call blocks execution so that other widgets cannot swap. We’re currently using 60 Hz monitors, and each video stream (main video as well as the thumbnails) is coming in at 30 FPS. To top it off, I cannot disable vsync because then the video will tear, which my boss is vehemently opposed to.

One other thing I have tried is to render in separate threads. This causes OpenGL to give good results up to a point… At some point, the screen starts tearing in one very obvious place.

Is it possible to swap a number of glX rendering contexts in one fell swoop? I wouldn’t mind altering gtkglext to be able to do this if necessary.

There are a couple GLX extensions that allow some variations of this behavior. Basically, what you want is a swap group. The application initiates swaps on each window, but the window system doesn’t actually perform the swap until all windows in the group are ready.

Check GLX_SGIX_swap_group and GLX_NV_swap_group. Keep in mind that neither one of these extensions is very widely supported. I think Nvidia only supports this functionality on Quadro cards (but I could be wrong).

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.