Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Automatic vsync under Win32 when using a double-buffer?

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2004
    Location
    Denmark
    Posts
    13

    Automatic vsync under Win32 when using a double-buffer?

    Hi,

    When using the PFD_DOUBLEBUFFER flag in my Windows application, the fps is equivalent to the refresh rate of my monitor; 60Hz yields 60fps, 75 Hz yields 75fps and so on. (ie. it seems to wait for a VBL before swapping the buffers).

    Does anyone know if this vsync feature is part of my graphics-driver or part of Microsoft's implementation of OpenGL?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    744

    Re: Automatic vsync under Win32 when using a double-buffer?

    No, this only happens if you have v-sync enabled, it does not have anything to do with double buffering.
    It is also not driver or microsoft specific as this works the same way on all systems.

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2004
    Location
    Denmark
    Posts
    13

    Re: Automatic vsync under Win32 when using a double-buffer?

    Ok, but if I don't use the double-buffer flag, I get way above 5000 fps and a constant CPU usage of 100%!?

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    744

    Re: Automatic vsync under Win32 when using a double-buffer?

    that's because it only works during double buffering because when you use single buffering you draw directly to the front buffer.

  5. #5
    Junior Member Newbie
    Join Date
    Jun 2004
    Location
    Denmark
    Posts
    13

    Re: Automatic vsync under Win32 when using a double-buffer?

    I tried to test the program on my brothers computer. His monitor runs at 60Hz, but I got 210fps, so obviously the fps-rate doesn't automatically adjust to the frequency when db is enabled. However, he has vsync disabled, which, as you (zeoverlord) suggested, is why the two numbers don't match

    However, I am a little confused about what you meant when you said "it does not have anything to do with double buffering", and in you next post stated "that's because it only works during double buffering" ... ?

    Thanks for your replies.

Posting Permissions

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