Changeset 697


Ignore:
Timestamp:
Mar 27, 2006, 10:01:27 AM (15 years ago)
Author:
Sam Hocevar
Message:
  • Reworked the OpenGL headers and Glut features detection (what did you expect).
Location:
libcaca/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/driver_gl.c

    r695 r697  
    2222#if defined(USE_GL)
    2323
    24 #ifndef USE_GLUTCHECKLOOP
    25 #include <GL/gl.h>
    26 #include <GL/glut.h>
    27 #include <GL/freeglut_ext.h>
     24#ifdef HAVE_OPENGL_GL_H
     25#   include <OpenGL/gl.h>
     26#   include <GLUT/glut.h>
    2827#else
    29 /* glutCheckLoop tested only under MacOSX, so using its default headers path */
    30 #include <OpenGL/gl.h>
    31 #include <GLUT/glut.h>
    32 #define glutMainLoopEvent glutCheckLoop
     28#   include <GL/gl.h>
     29#   include <GL/glut.h>
     30#   include <GL/freeglut_ext.h>
     31#endif
     32
     33#ifdef HAVE_GLUTCHECKLOOP
     34#   define glutMainLoopEvent glutCheckLoop
    3335#endif
    3436
  • libcaca/trunk/configure.ac

    r694 r697  
    147147if test "${enable_gl}" != "no"; then
    148148  ac_cv_my_have_gl="no"
    149   AC_CHECK_HEADERS(GL/gl.h,
     149  AC_CHECK_HEADERS(GL/gl.h OpenGL/gl.h,
    150150   [AC_CHECK_HEADERS(GL/glut.h,
    151151     [AC_CHECK_LIB(glut, glutMainLoopEvent,
    152        [ac_cv_my_have_gl="yes"
    153         AC_DEFINE(USE_GL, 1, Define to 1 to activate the OpenGL backend driver)
    154         CACA_LIBS="${CACA_LIBS} -lGL -lglut"
    155         CACA_DRIVERS="${CACA_DRIVERS} gl"])]
     152       [ac_cv_my_have_gl="yes"])]
    156153     [AC_CHECK_LIB(glut, glutCheckLoop,
    157154       [ac_cv_my_have_gl="yes"
    158         AC_DEFINE(USE_GLUTCHECKLOOP, 1, Define to 1 to activate the glut3 glutCheckLoop call)
    159         CACA_LIBS="${CACA_LIBS} -lGL -lglut"
    160         CACA_DRIVERS="${CACA_DRIVERS} gl"])])])
    161   if test "${ac_cv_my_have_gl}" = "no" -a "${enable_gl}" = "yes"; then
     155        AC_DEFINE(HAVE_GLUTCHECKLOOP, 1, Define to 1 if you have the `glutCheckLoop' function.)])])
     156      break])
     157  if test "${ac_cv_my_have_gl}" = "yes"; then
     158    AC_DEFINE(USE_GL, 1, Define to 1 to activate the OpenGL backend driver)
     159    CACA_LIBS="${CACA_LIBS} -lGL -lglut"
     160    CACA_DRIVERS="${CACA_DRIVERS} gl"
     161  elif test "${enable_gl}" = "yes"; then
    162162    AC_MSG_ERROR([cannot find OpenGL+FreeGLUT development files])
    163163  fi
Note: See TracChangeset for help on using the changeset viewer.