Search code examples
windowsopenglvsyncopengl-extensions

wglext - extension not installed in OpenGL context


I am trying to disable vsync in OpenGl with WGL_EXT_swap_control using wglSwapIntervalEXT(int interval).

I am trying to include the wglext header but after much searching it seems it is not installed on my pc (using opengl extension viewer to find this). I have tried installing the windows sdk and updating the .net framework but still cannot install this extension.

Is there anyway to include this. my graphics card is an nVidia GTX 770m. Or is there a simpler way to disable vsync.

Thanks


Solution

  • So, a friend managed to figure this out without glew. So if anyone needs help with it this should be something similar to what you are looking for

    void SetVSync(bool sync)  
    {   
    typedef BOOL(APIENTRY *PFNWGLSWAPINTERVALPROC)(int);
    PFNWGLSWAPINTERVALPROC wglSwapIntervalEXT = 0;
    
    const char *extensions = (char*)glGetString(GL_EXTENSIONS);
    
    wglSwapIntervalEXT = (PFNWGLSWAPINTERVALPROC)wglGetProcAddress("wglSwapIntervalEXT");
    
    if (wglSwapIntervalEXT)
        wglSwapIntervalEXT(sync);
    }