I\'d like to have both the includes for OS X as well as linux in my opengl program (C++) how can I set my program to use one if the other is not available? Here\'s what i\'m cur
Here is what I use:
#ifdef __APPLE__
#include
#include
#include
#else
#ifdef _WIN32
#include
#endif
#include
#include
#include
#endif
All compilers for the mac (well,I guess that's gcc, and maybe clang) should define __APPLE__
. I throw the _WIN32
in there since windows.h must be included before gl.h on windows platforms, it seems.
You can put this in its own include file (say gl_includes.h) if you have many files that need OpenGL
-matt