如何检查的OpenGL的版本在Windows 7kl版本、OpenGL、kl、Windows

由网友(人心所向便是光)分享简介:我使用的是Windows 7中,我使用了OpenGL上编程。但是我发现有一些功能,我可以使用。所以,我要检查了OpenGL的版本在我的系统。我用下面的code,以检查它I am using the Windows 7. I am programming using the OpenGL on it. But I f...

我使用的是Windows 7中,我使用了OpenGL上编程。但是我发现有一些功能,我可以使用。所以,我要检查了OpenGL的版本在我的系统。 我用下面的code,以检查它

I am using the Windows 7. I am programming using the OpenGL on it. But I found that there are some features I can use. So I want to check the version of the OpenGL on my system. I use the code below to check it

const char* version = (const char*)glGetString(GL_VERSION); 

但我得到一个空指针。如果我要升级我的OpenGL的,我该怎么办?

But I get a null pointer. And if I want to upgrade my OpenGL, what should I do?

推荐答案

您需要一个GL上下文电流之前,你可以问你有哪个版本。

You need a GL context current before you can ask which version you have.

因此​​,首先创建一个背景下,调用wglMakeCurrent它,你应该能够在那之后调用glGetString。

So first, create a context, call wglMakeCurrent on it, and you should be able to call glGetString after that.

这是被报道是从已安装的驱动程序未来版本。您的硬件可以支持OpenGL版本本身不是升级(因为一些硬件功能将被丢失,支持最新和最伟大)。

The version that gets reported is coming from the driver that you have installed. The OpenGL version that your hardware can support is not itself "upgradable" (because some hardware features will be missing to support the latest and greatest).

所以最好你能做的就是升级驱动程序,但不要让您的希望高将导致新的OpenGL。

So the best you can do is upgrade your driver, but don't get your hopes to high it will result in a newer OpenGL.

阅读全文

相关推荐

最新文章