PDA

View Full Version : vsync and three contexts, same window



rlx02
08-21-2009, 08:55 AM
Hi,

I ported a sonogram display program to FLTK. The program animates three panels on the same window. Each panel uses its own context (provided by FLTK). When I set 'sync to VBLANK' on NVIDIA settings in Vista, each of the three panels gets updated at successive VBLANK's resulting in a frame rate of 20 frames per second instead of the expected 60 fps. The program is SonasoundP on SourceForge.

I would like to synchronize the three contexts to the same VBLANK (or VSYNC).

I have searched this site and the net and found a lot of material. but I am a bit confused. The first approach would be to use a common context for the tree panels, but I did not find the specifics on how to do that. The other approach, would be to deactivate VBLANK before painting each panel and reactivate it afterwards (SwapInterval_aka_vsync). There is also the 'swap group' but that is specific to NVIDIA I guess.

I would appreciate very much if someone could give me additional pointers on how to synchronize multiple contexts to a common VBLANK.

Additionally, is there a way to get a signal from OpenGL telling when VBLANK occurs?

Thank you.