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

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

问题描述

我使用的是 Windows 7.我正在使用 OpenGL 进行编程.但我发现我可以使用一些功能.所以我想在我的系统上检查 OpenGL 的版本.我使用下面的代码来检查它

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.

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

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