Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check the Version of the OpenGL on Windows 7kl

Tags:

opengl

3d

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

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

like image 494
Yongwei Xing Avatar asked Dec 21 '22 20:12

Yongwei Xing


1 Answers

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

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

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).

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.

like image 133
Bahbar Avatar answered Jan 05 '23 13:01

Bahbar