Browse Source

* Reworked the OpenGL headers and Glut features detection (what did you

expect).
tags/v0.99.beta14
Sam Hocevar sam 19 years ago
parent
commit
f4aed04efd
2 changed files with 19 additions and 17 deletions
  1. +10
    -8
      caca/driver_gl.c
  2. +9
    -9
      configure.ac

+ 10
- 8
caca/driver_gl.c View File

@@ -21,15 +21,17 @@


#if defined(USE_GL) #if defined(USE_GL)


#ifndef USE_GLUTCHECKLOOP
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/freeglut_ext.h>
#ifdef HAVE_OPENGL_GL_H
# include <OpenGL/gl.h>
# include <GLUT/glut.h>
#else #else
/* glutCheckLoop tested only under MacOSX, so using its default headers path */
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
#define glutMainLoopEvent glutCheckLoop
# include <GL/gl.h>
# include <GL/glut.h>
# include <GL/freeglut_ext.h>
#endif

#ifdef HAVE_GLUTCHECKLOOP
# define glutMainLoopEvent glutCheckLoop
#endif #endif


#include <string.h> #include <string.h>


+ 9
- 9
configure.ac View File

@@ -146,19 +146,19 @@ fi


if test "${enable_gl}" != "no"; then if test "${enable_gl}" != "no"; then
ac_cv_my_have_gl="no" ac_cv_my_have_gl="no"
AC_CHECK_HEADERS(GL/gl.h,
AC_CHECK_HEADERS(GL/gl.h OpenGL/gl.h,
[AC_CHECK_HEADERS(GL/glut.h, [AC_CHECK_HEADERS(GL/glut.h,
[AC_CHECK_LIB(glut, glutMainLoopEvent, [AC_CHECK_LIB(glut, glutMainLoopEvent,
[ac_cv_my_have_gl="yes"
AC_DEFINE(USE_GL, 1, Define to 1 to activate the OpenGL backend driver)
CACA_LIBS="${CACA_LIBS} -lGL -lglut"
CACA_DRIVERS="${CACA_DRIVERS} gl"])]
[ac_cv_my_have_gl="yes"])]
[AC_CHECK_LIB(glut, glutCheckLoop, [AC_CHECK_LIB(glut, glutCheckLoop,
[ac_cv_my_have_gl="yes" [ac_cv_my_have_gl="yes"
AC_DEFINE(USE_GLUTCHECKLOOP, 1, Define to 1 to activate the glut3 glutCheckLoop call)
CACA_LIBS="${CACA_LIBS} -lGL -lglut"
CACA_DRIVERS="${CACA_DRIVERS} gl"])])])
if test "${ac_cv_my_have_gl}" = "no" -a "${enable_gl}" = "yes"; then
AC_DEFINE(HAVE_GLUTCHECKLOOP, 1, Define to 1 if you have the `glutCheckLoop' function.)])])
break])
if test "${ac_cv_my_have_gl}" = "yes"; then
AC_DEFINE(USE_GL, 1, Define to 1 to activate the OpenGL backend driver)
CACA_LIBS="${CACA_LIBS} -lGL -lglut"
CACA_DRIVERS="${CACA_DRIVERS} gl"
elif test "${enable_gl}" = "yes"; then
AC_MSG_ERROR([cannot find OpenGL+FreeGLUT development files]) AC_MSG_ERROR([cannot find OpenGL+FreeGLUT development files])
fi fi
fi fi


Loading…
Cancel
Save