Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I upgrade my OpenGL from 2.1 to 3.3 on Mac OSX?

Tags:

macos

opengl

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.

like image 633
jackcogdill Avatar asked Nov 17 '14 20:11

jackcogdill


People also ask

Can I update OpenGL on Mac?

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.

Can you upgrade your OpenGL version?

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.

What version of OpenGL does macOS support?

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.


2 Answers

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.

like image 88
Andon M. Coleman Avatar answered Sep 23 '22 17:09

Andon M. Coleman


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

like image 29
Mortennobel Avatar answered Sep 23 '22 17:09

Mortennobel