diff options
-rw-r--r-- | configure.ac | 39 | ||||
-rw-r--r-- | m4/Makefile.am | 1 | ||||
-rw-r--r-- | m4/opengl.m4 | 72 | ||||
-rw-r--r-- | src/video_out/video_out_opengl.c | 3 |
4 files changed, 75 insertions, 40 deletions
diff --git a/configure.ac b/configure.ac index cc85c0234..86e46d7fe 100644 --- a/configure.ac +++ b/configure.ac @@ -394,44 +394,7 @@ AC_SUBST(ZLIB_LIBS) dnl --------------------------------------------- dnl Check for OpenGL & [GLut | GLU] dnl --------------------------------------------- - -case "$host" in - *darwin*) dnl Use native interface - OPENGL_LIBS="-framework Carbon -framework AGL -framework OpenGL -framework AppKit" - OPENGL_CFLAGS="-framework Carbon -framework AGL -framework OpenGL -framework AppKit" - AC_SUBST(OPENGL_LIBS) - AC_SUBST(OPENGL_CFLAGS) - ;; - *) - AC_CHECK_LIB(GL, glBegin, - [AC_CHECK_HEADER(GL/gl.h, - [ ac_have_opengl="yes" - OPENGL_LIBS="-lGL" - AC_CHECK_LIB(glut, glutInit, dnl check for glut - [ ac_have_glut="yes" - GLUT_LIBS="-lglut" - AC_DEFINE(HAVE_GLUT,1,[Define this if you have GLut support available]) - AC_DEFINE(HAVE_OPENGL,1,[Define this if you have OpenGL support available]) ], - [ ac_have_glut="no" dnl fallback, check for GLU - AC_CHECK_LIB(GLU, gluPerspective, - [ ac_have_glu="yes" - GLU_LIBS="-lGLU -lm" - AC_DEFINE(HAVE_GLU,1,[Define this if you have GLU support available]) - AC_DEFINE(HAVE_OPENGL,1,[Define this if you have OpenGL support available]) ], - [ ac_have_glu="no" ], - [$X_LIBS $X_PRE_LIBS $OPENGL_LIBS -lGLU -lm $X_EXTRA_LIBS])], - [$X_LIBS $X_PRE_LIBS -lglut $X_EXTRA_LIBS]) - ], - [])], - [], - [$X_LIBS $X_PRE_LIBS -lGL $X_EXTRA_LIBS]) - ;; -esac - -AC_SUBST(OPENGL_LIBS) -AC_SUBST(GLUT_LIBS) -AC_SUBST(GLU_LIBS) -AM_CONDITIONAL(HAVE_OPENGL, [ test x$ac_have_opengl = "xyes" -a x$ac_have_glut="xyes" -o x$ac_have_opengl = "xyes" -a x$ac_have_glu="xyes" ] ) +AM_PATH_OPENGL() dnl --------------------------------------------- diff --git a/m4/Makefile.am b/m4/Makefile.am index 16bc8ba31..7d45bdcd2 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -27,6 +27,7 @@ EXTRA_DIST = \ libFLAC.m4 \ libfame.m4 \ ogg.m4 \ + opengl.m4 \ pkg.m4 \ progtest.m4 \ sdl.m4 \ diff --git a/m4/opengl.m4 b/m4/opengl.m4 new file mode 100644 index 000000000..c8ec7bd1b --- /dev/null +++ b/m4/opengl.m4 @@ -0,0 +1,72 @@ +dnl +dnl Check for OpenGL & [Glut | GLU] +dnl +dnl AM_PATH_OPENGL([ACTION IF FOUND [, ACTION IF NOT FOUND]]) +dnl + +AC_DEFUN([AM_PATH_OPENGL], [ + + AC_ARG_ENABLE(opengl, AC_HELP_STRING([--disable-opengl], [do not build OpenGL plugin]), + [enableopengl=$enableval], + [enableopengl="yes"] + ) + + if test x$enableopengl = "xyes"; then + case "$host" in + *darwin*) dnl Use native interface + OPENGL_LIBS="-framework Carbon -framework AGL -framework OpenGL -framework AppKit" + OPENGL_CFLAGS="-framework Carbon -framework AGL -framework OpenGL -framework AppKit" + ac_use_opengl="yes" + ;; + *) + AC_CHECK_LIB(GL, glBegin, + [AC_CHECK_HEADER(GL/gl.h, + [ac_have_opengl="yes" + OPENGL_LIBS="-lGL" + dnl check for glut + AC_CHECK_LIB(glut, glutInit, + [ac_have_glut="yes" + GLUT_LIBS="-lglut" + AC_DEFINE(HAVE_GLUT,1,[Define this if you have GLut support available]) + AC_DEFINE(HAVE_OPENGL,1,[Define this if you have OpenGL support available]) + ], + [ac_have_glut="no" + dnl fallback, check for GLU + AC_CHECK_LIB(GLU, gluPerspective, + [ac_have_glu="yes" + GLU_LIBS="-lGLU -lm" + AC_DEFINE(HAVE_GLU,1,[Define this if you have GLU support available]) + AC_DEFINE(HAVE_OPENGL,1,[Define this if you have OpenGL support available]) + ], + [ac_have_glu="no"], + [$X_LIBS $X_PRE_LIBS $OPENGL_LIBS -lGLU -lm $X_EXTRA_LIBS] + ) + ], + [$X_LIBS $X_PRE_LIBS -lglut $X_EXTRA_LIBS] + ) + ] + )], + [], + [$X_LIBS $X_PRE_LIBS -lGL $X_EXTRA_LIBS] + ) + if test x$ac_have_opengl = "xyes" -a x$ac_have_glut = "xyes" -o x$ac_have_opengl = "xyes" -a x$ac_have_glu = "xyes"; then + ac_use_opengl=yes + fi + ;; + esac + fi + + AC_SUBST(OPENGL_CFLAGS) + AC_SUBST(OPENGL_LIBS) + AC_SUBST(GLUT_LIBS) + AC_SUBST(GLU_LIBS) + AM_CONDITIONAL(HAVE_OPENGL, [test x$ac_use_opengl = "xyes"]) + + dnl result + if test x$ac_use_opengl = "xyes"; then + ifelse([$1], , :, [$1]) + else + ifelse([$2], , :, [$2]) + fi + +]) diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c index 99016c182..52496b24f 100644 --- a/src/video_out/video_out_opengl.c +++ b/src/video_out/video_out_opengl.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_opengl.c,v 1.38 2004/04/30 22:12:15 jcdutton Exp $ + * $Id: video_out_opengl.c,v 1.39 2004/08/26 17:57:53 valtri Exp $ * * video_out_glut.c, glut based OpenGL rendering interface for xine * Matthias Hopf <mat@mshopf.de> @@ -557,7 +557,6 @@ static void opengl_render_image (opengl_driver_t *this, opengl_frame_t *frame, glXDestroyContext (this->display, this->context); } - DEBUGF ((stderr, "screen %dx%d\n", ((Screen *) this->screen)->width, ((Screen *)this->screen)->height)); DEBUGF ((stderr, "glXChooseVisual\n")); this->vinfo = glXChooseVisual (this->display, this->screen, glxAttrib); |