Tianyi Cui
Tianyi Cui

Reputation: 4083

How to do OpenGL 3 programming on OS X with a GeForce 9400

I have a MacBook Pro with a GeForce 9400 graphics card. Wikipedia said this card supports OpenGL 3.

But the header and library shipped with OS X 10.6 seems to be OpenGL 2 only (I checked the files in /usr/X11/include/).

I need to do some OpenGL 3 programming. Can I do it with my current hardware and OS? What do I need to get and install?

Upvotes: 5

Views: 7609

Answers (5)

Andreas
Andreas

Reputation: 1400

The best place to check OpenGL support on the various OSX and Mac combinations is: http://developer.apple.com/graphicsimaging/opengl/capabilities/

See the "Core" subpage for 10.7+

OpenGL 3.2 with GLSL 1.5 on 10.7.2 isn't too bad.

Upvotes: 1

Nicolas Lefebvre
Nicolas Lefebvre

Reputation: 4282

Sadly, I don't think you can yet, as detailed here.

I believe Lion will upgrade OpenGL to 3.2 for OS X though (which is still short of the more useful 3.3 unfortunately).

NB: I do not own a Mac, this is purely from trying to learn modern OpenGL on the windows side and digging around to understand how portable it would be.

Edit: this thread on the official OpenGL forums has more detail. Although (see comments below this answer) it may not be completely clear why vendors cannot provide OpenGL 3+ compliant drivers, it seems pretty clear that there is no way to use fully OpenGL 3.3 compliant code and shaders in OS X. Some workarounds are provided in that thread however, as well as in my first link.

Upvotes: 2

Michael Platings
Michael Platings

Reputation: 3165

Windows OpenGL developer here. On Windows 7 only OpenGL 1.4 is officially supported, but everyone gets around this limitation by querying which functions are available at run-time.

On OSX I expect you can do the same thing. The easiest way to do this is with The OpenGL Extension Wrangler Library: http://www.opengl.org/sdk/libs/GLEW/

Upvotes: 0

Ben Voigt
Ben Voigt

Reputation: 283793

(Disclaimer: This information is based on taking Windows OpenGL and replacing wgl with glX. But I did verify that the corresponding extensions exist in GLX land)

You won't find OpenGL 3 support in any header files. Rather you need the GLX_ARB_create_context extension.

The other answers are probably correct about missing support in OSX, but even when support comes, you'll have to use glXGetProcAddress and load the extension. (Can't video card manufacturers add support for these extensions through their driver? Why does it require "OS support"?)

Upvotes: 0

Mr. Berna
Mr. Berna

Reputation: 10655

Your current hardware can support OpenGL 3, but not the OS. Mac OS X 10.7 (Lion) should support OpenGL 3, which is a solution only if you can wait many months.

Your only option right now is to switch to a different OS such as Windows or Linux. You'll have to boot from this other operating system, because the virtual machine systems present a virtual video card to the guest operating systems, and none have OpenGL 3 compatible virtual video cards.

Upvotes: 0

Related Questions