Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Win32, OpenGL, VSync and multiple monitors with different refresh rates

  1. #1
    Newbie Newbie
    Join Date
    Jan 2014

    Win32, OpenGL, VSync and multiple monitors with different refresh rates

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

    Code :
    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

    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?

  2. #2
    Intern Contributor
    Join Date
    Sep 2004
    I don't think there is a way in OpenGL or wgl or their extension to help you here.

    The only thing that should work is triple-buffering. In theory the swap should not block if triple-buffering and VSync is enabled. But of course this is a vendor/implementation dependent thing, and can't be controlled via gl or wgl, as far as I know. And at worst you'll end up rendering frames that won't be displayed.

  3. #3
    Junior Member Newbie
    Join Date
    May 2012
    Are you working on Windows VISTA/7/8? If so, you may experiment with turning off Aero ( Desktop Window Manager Session Manager Service ) else the whole desktop might be composited in the lowest frame rate?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts