Results 1 to 2 of 2

Thread: Vertical Retrace

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2002
    Posts
    17

    Vertical Retrace

    I'm programming OpenGL under Win32.
    Is there some way to wait for a vertical
    retrace before I swap the front/back buffer ?
    Sometimes (depends on how the scene looks like) you see it flickering a bit. It's not
    really bad, but it would be nice if I could
    get rid of it, even if this will cost some
    FPS.

    regards
    Ann

  2. #2
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,342

    Re: Vertical Retrace

    Use the swap control extension ... this code will enable Vsync if available through this extension:

    typedef void (APIENTRY * PFNWGLEXTSWAPCONTROLPROC) (int i);
    PFNWGLEXTSWAPCONTROLPROC wglSwapControl = NULL;
    wglSwapControl = (PFNWGLEXTSWAPCONTROLPROC) wglGetProcAddress("wglSwapIntervalEXT");
    if (wglSwapControl != NULL) wglSwapControl(1);

Similar Threads

  1. Synchronizing to vertical retrace
    By nt in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 03-05-2009, 09:47 AM
  2. Vertical retrace interrupt?
    By frink in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 03-17-2003, 05:22 AM
  3. Vertical Retrace Reset
    By frink in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 11-11-2002, 12:26 PM
  4. Vertical retrace sync
    By drslush in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-07-2002, 05:04 PM
  5. VERTICAL RETRACE
    By Dukenuke in forum OpenGL: Linux
    Replies: 1
    Last Post: 03-13-2001, 08:40 AM

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