如何检查的OpenGL的版本在Windows 7kl [英] How to check the Version of the OpenGL on Windows 7kl

查看:337
本文介绍了如何检查的OpenGL的版本在Windows 7kl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是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.

这篇关于如何检查的OpenGL的版本在Windows 7kl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆