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 10 of 11

Thread: wglSwapIntervalEXT problem

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2013
    Posts
    10

    wglSwapIntervalEXT problem

    I need vsync in my project. So, I called wglSwapIntervalEXT(60). At function BOOL wglSwapIntervalEXT(int interval), the parameter interval must be my monitor frequency? Do I need call another function to enable vsync?

    I just called wglSwapIntervalEXT(60), but doesn't works...

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    985
    If you would have read the spec, you would know:

    Quote Originally Posted by WGL_EXT_swap_control
    The parameter <interval> specifies the minimum number of video frames that are displayed before a buffer swap will occur.


    Thus no matter what is your monitor frequency, if you want to enable vsync to match your monitor frequency you have to set it to "1", which is actually the default behavior.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2013
    Posts
    10
    Now I call the function by this way: wglSwapIntervalEXT(1)

    I'm using cout to see the values of interval between the frames. I think the values must be equals at all iterations and, as my monitor frequency is 60 Hz, this value must be 1000/60 = 16.66 ms. But I got the values 1 or 2 only, like the vsync was disabled... My code:

    while(true){
    draw code...
    SDL_GL_SwapBuffers();
    current = clock();
    cout << current - old << endl;
    old = current;
    }

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    985
    Don't forget that there may be settings in your driver's control panel that may prevent the swap internal from taking effect. Usually there are three options on the control panel: always on, always off and application controlled. Make sure that you don't have "always off" selected.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  5. #5
    Junior Member Newbie
    Join Date
    Jan 2013
    Posts
    10
    I didn't found this option in my driver' control panel =/ But the function wglSwapIntervalEXT(1) returns 1. This means that the vsync should be enabled?

  6. #6
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,145
    Are you serious?

  7. #7
    Quote Originally Posted by S1ngular View Post
    Don't forget vsync works only in fullscreen mode.
    No, it doesn't.

Tags for this Thread

Posting Permissions

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