扩展未在OpenGL上下文中安装

扩展未在OpenGL上下文中安装

本文介绍了wglext-扩展未在OpenGL上下文中安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用wglSwapIntervalEXT(int interval)在带有WGL_EXT_swap_control的OpenGl中禁用vsync.

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

我正在尝试包含wglext标头,但经过大量搜索后,似乎没有将其安装在我的PC上(使用opengl扩展查看器查找该标头).我尝试安装Windows sdk并更新.net框架,但仍然无法安装此扩展名.

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.

无论如何,有没有要包括这个.我的显卡是nVidia GTX 770m.还是有一种更简单的方法来禁用vsync.

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

谢谢

推荐答案

因此,一个朋友设法解决了这一问题.因此,如果有人需要帮助,这应该类似于您正在寻找的

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);
}

这篇关于wglext-扩展未在OpenGL上下文中安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 02:02