I am trying to program OpenGL 3 in C on my Macbook Pro.
My graphics card is NVIDIA GeForce 320M 256 MB
, but I have OpenGL 2.1 According to wikipedia, I should be able to use OpenGL 3.3:
However, when I run glxinfo | grep -i opengl
, I get OpenGL version string: 2.1 NVIDIA-8.24.16 310.90.9.05f01
.
How do I go about upgrading it? I am running Mavericks.
Technically, you cannot get a (windowed) OpenGL 3.2 context programming purely in C on OS X. You have to use part of Cocoa (an Objective-C framework) called NSOpenGL; AGL (deprecated C-based API) as well as the really old X server implementation (XQuartz) are perpetually limited to OpenGL 2.1.
On the official site, navigate to the graphics driver and choose your operating system. Download the latest drivers for your graphics card and install it to your computer. This will also update the OpenGL on your computer.
According to Apple, OpenGL is no longer supported. However, it appears v4. 1 of OpenGL was supported on many devices as of July 28, 2020.
Technically, you cannot get a (windowed) OpenGL 3.2 context programming purely in C on OS X.
You have to use part of Cocoa (an Objective-C framework) called NSOpenGL; AGL (deprecated C-based API) as well as the really old X server implementation (XQuartz) are perpetually limited to OpenGL 2.1.
Apple's own implementation of GLUT wraps NSOpenGL (FreeGLUT does not), and so do GLFW, SDL, etc. They have small portions that are written in Objective-C to interface with NSOpenGL and this allows them to create window-based OpenGL 3.2+ render contexts even in C software.
Now, the problem here is actually that glxinfo
uses XQuartz, which does not support OpenGL 3.2+. I would suggest you use the OpenGL Extension Viewer on the Mac App store if you want detailed info about your OpenGL capabilities.
Since you're just starting out with OpenGL development on OS X, I would also suggest you have a look here for a quick overview of the various APIs.
You cannot upgrade your graphics drivers since they are provided by Apple. But your system should support OpenGL 3.3 ( https://developer.apple.com/opengl/capabilities/ ). When creating a OpenGL context you must request a CoreProfile mode. If you are using GLUT this can be done this way:
GLUT on OS X with OpenGL 3.2 Core Profile
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