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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With