Results 1 to 5 of 5

Thread: enable vsync for bufferswapping

  1. #1
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,042

    enable vsync for bufferswapping

    Hi.

    I use OpenGl with windows and of course I use doublebuffering. However I have one problem. When I call SwapBuffers it doesnt interest the function to wait until the whole picture has been refreshed. This makes opengl flicker sometimes. I am absolutely sure that I use doublebuffering, so dont tell me to enable this.
    Then I found out, that I can force my graphicscard to wait until the screen has been refreshed. Now I dont have this flickering anymore but of course only on my PC. Is there any function to enable this. Or at least is there any function which tells me wether the screen has been refreshed or not?

    Thank you.
    GLIM - Immediate Mode Emulation for GL3

  2. #2
    Senior Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Austin, TX, USA
    Posts
    142

    Re: enable vsync for bufferswapping

    The feature you are referring to is call "Sync to vertical blank". There is no inherent GL function to turn this on, though many graphics device drivers have the capability to toggle it, using a registry flag.

    The flashing occurs when the scene draws more frames than the refresh rate of the monitor. This causes tearing. That said, if you would like to implement a method to prevent this phenomenon, you need to look at a frame rate limiter.
    Rather than update and redraw the scene as fast as the card can process the scene, you limit the update and buffer swap to 60 frames per second (or whatever you like, maybe 30 fps).

    Does that help?

    Glossifah

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,042

    Re: enable vsync for bufferswapping

    Thank you. IŽll try this method. However I really think someone should write such a function.
    GLIM - Immediate Mode Emulation for GL3

  4. #4
    Senior Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Austin, TX, USA
    Posts
    142

    Re: enable vsync for bufferswapping

    I'll get right on that. </sarcasm>



    Glossifah

  5. #5
    Senior Member Regular Contributor
    Join Date
    Jun 2000
    Location
    B.C., Canada
    Posts
    367

    Re: enable vsync for bufferswapping

    There is an extension to OpenGL that lets you control the frame swap.

    It's called WGL_EXT_swap_control. Many video cards support it. You can find more info at http://oss.sgi.com/projects/ogl-samp...ap_control.txt

    j

    [This message has been edited by j (edited 12-07-2000).]

Similar Threads

  1. Adjusting vsync through code and general vsync question
    By lvick in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 09-13-2012, 02:44 PM
  2. Everything is fog , when i enable fog
    By Adrian B in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-09-2011, 04:47 PM
  3. How to enable/force VSYNC ?
    By Dylan in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 06-11-2007, 02:51 AM
  4. A way to enable TRUE vsync with Win32 + OGL ?
    By Nicolas Lelong in forum OpenGL: Advanced Coding
    Replies: 11
    Last Post: 09-19-2000, 11:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean