Skip to content

Commit

Permalink
clarify glut defines
Browse files Browse the repository at this point in the history
  • Loading branch information
mgood7123 committed Nov 6, 2021
1 parent 93e6761 commit b206726
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions demo/demo-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,24 @@

#ifdef HAVE_GLUT
#if defined(__APPLE__)

// glut includes gl.h
// but we need gl3.h
// and including both gl.h and gl3.h produces conflict warnings
// so we define __gl_h_ here so gl.h gets skipped
// since gl.h is ifdef guarded with __gl_h_

#define __gl_h_

// include glut

#include <GLUT/glut.h>

// undefine __gl_h_ after we include glut
// incase it causes other problems

#undef __gl_h_

#else
#include <GL/glut.h>
#endif
Expand Down

0 comments on commit b206726

Please sign in to comment.