4

My game engine takes a simplistic approach to supporting multiple windows with a single OpenGL context in the following way:

Activate OpenGL context on window 1  
Draw scene in to window 1

Activate OpenGL context on window 2  
Draw scene in to window 2

Activate OpenGL context on window 3  
Draw scene in to window 3

For all Windows
SwapBuffers

This works fine with monitors of the same refresh rate (with VSync on or off), and now I'm experimenting with monitors of different refresh rates. With V-Sync disabled, as long as the engine can produce enough frames, a window on a higher refresh rate monitor won't get slowed down by a window on a slower refresh rate monitor, as SwapBuffers doesn't block. With V-Sync enabled, SwapBuffers will sync to the slowest monitor and windows on faster monitors will get slowed down.

If there any way of fixing this without resorting to a thread and OpenGL context for each window? I was thinking along the lines of a non-blocking SwapBuffers and checking if a window is going through a swap, and if not then swapping it's buffers or something?

Rajveer
  • 847
  • 11
  • 28
  • Is it a different scene for each monitor? Out of interest why don't you want the other monitors to slow down with vsync? would different FPS not mess with the eyes? – chrispepper1989 Aug 13 '14 at 21:36
  • Yup it would be the same scene for each monitor. I'm experimenting with head mounted displays which run at a higher refresh rate than the standard 60Hz a monitor does, and would like to play around with multiplayer on a single system. Also I know there are some situations where people have a higher refresh rate monitor for gaming (e.g. 120Hz), and secondary slower monitors (e.g. 60Hz) - in these situations I think having secondary monitors just for extra information shouldn't eliminate the benefit of the 120Hz screen. As long as my engine supports both options, this could be a user choice :) – Rajveer Aug 13 '14 at 21:44

0 Answers0