[tlbuild] More on GLEW

Richard Koch koch at uoregon.edu
Thu Mar 28 02:40:29 CET 2019


Folks,

I thought it strange that asy compiled well until now, but now it failed due to a missing piece of openGL. This makes little sense because Apple only recently deprecated OpenGL and we compile on Sierra rather than Mojave.

So I did a search and discovered the following page at stack overflow:

	https://stackoverflow.com/questions/12229714/building-glew-for-mac-osx

This provided information so crucial that I'll copy it here:

The original question contained this line:

The engine uses modern opengl (shader based) and so requires GLEW

The answer said:

GLEW is not a prerequisite for using modern OpenGL features. It is a method to load extended functionality, not the only one. You're on MacOS X so, the extension system is of little use for you anyway, because the OpenGL version supported is entirely determined by the OS and the available framework. Apple develops the OpenGL drivers themself and the extensions they provide are only those, that are for features not found in the OpenGL specification (i.e. vendor specific and EXT). All you need is a version of the OpenGL Framework new enough. Any MacOS X released after 2006 can do it.

This led to a new stack overflow question:

How would a program including GLEW be ported to compile on OS X?

The answer is:

Check for the __APPLE__ preprocessor macro and only if that one's not been defined include the GLEW header. And for the case __APPLE__ is defined, define (empty) macros that turn glew… function calls into no-ops.


All this is above my pay grade, but perhaps John can deal with it. 

Richard Koch
koch at uoregon.edu


More information about the tlbuild mailing list