From 6f8315d8f65066fda4ca9498f5d7beec46729d11 Mon Sep 17 00:00:00 2001 From: Daniel Caujolle-Bert Date: Wed, 23 Jan 2002 23:27:10 +0000 Subject: Change/fix opengl checks, add a glut fallback (GLU). CVS patchset: 1445 CVS date: 2002/01/23 23:27:10 --- acconfig.h | 3 +++ configure.in | 37 ++++++++++++++++++++++++++----------- src/video_out/Makefile.am | 2 +- src/video_out/video_out_opengl.c | 11 +++++++++-- 4 files changed, 39 insertions(+), 14 deletions(-) diff --git a/acconfig.h b/acconfig.h index f50b5ced5..03c086399 100644 --- a/acconfig.h +++ b/acconfig.h @@ -66,6 +66,9 @@ /* Define this if you have GLut support available */ #undef HAVE_GLUT +/* Define this if you have GLU support available */ +#undef HAVE_GLU + /* Define this if you have libXinerama installed */ #undef HAVE_XINERAMA diff --git a/configure.in b/configure.in index dc20b4612..6f3c5875f 100644 --- a/configure.in +++ b/configure.in @@ -241,21 +241,32 @@ AC_PREREQ_LIBTOOL(1.4.0, xv_lib="libXv.a", xv_lib="libXv.so") dnl -dnl Check for OpenGL & GLut +dnl Check for OpenGL & [GLut | GLU] dnl AC_CHECK_LIB(GL, glBegin, - OPENGL_LIBS="-lGL" - ac_have_opengl="yes",, - -lGL) + [ 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) + AC_DEFINE(HAVE_OPENGL) ], + [ ac_have_glut="no" dnl fallback, check for GLU + AC_CHECK_LIB(GLU, gluPerspective, + [ ac_have_glu="yes" + GLU_LIBS="-lGLU" + AC_DEFINE(HAVE_GLU) + AC_DEFINE(HAVE_OPENGL) ], + [ ac_have_glu="no" ], + [$X_LIBS $X_PRE_LIBS $OPENGL_LIBS -lGLU $X_EXTRA_LIBS])], + [$X_LIBS $X_PRE_LIBS -lglut $X_EXTRA_LIBS]) + ], + [], + [$X_LIBS $X_PRE_LIBS -lGL $X_EXTRA_LIBS]) AC_SUBST(OPENGL_LIBS) -AM_CONDITIONAL(HAVE_OPENGL, test x$ac_have_opengl = "xyes") - -AC_CHECK_LIB(glut, glutInit, - GLUT_LIBS="-lglut" - ac_have_glut="yes",, - -lglut) AC_SUBST(GLUT_LIBS) -AM_CONDITIONAL(HAVE_GLUT, test x$ac_have_glut = "xyes") +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" ] ) @@ -922,6 +933,10 @@ if test x"$no_x" != "xyes"; then echo " - Xv (XVideo *shared*)" fi fi + 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 + echo " - OpenGL" + fi fi if test x$no_aalib != "xyes"; then echo " - aa (Ascii ART)" diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am index b8ae2c2f3..7b45d752c 100644 --- a/src/video_out/Makefile.am +++ b/src/video_out/Makefile.am @@ -49,7 +49,7 @@ xineplug_vo_out_xshm_la_LDFLAGS = -avoid-version -module xineplug_vo_out_opengl_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \ alphablend.c video_out_opengl.c -xineplug_vo_out_opengl_la_LIBADD = $(OPENGL_LIBS) $(GLUT_LIBS) $(X_LIBS) +xineplug_vo_out_opengl_la_LIBADD = $(OPENGL_LIBS) $(GLUT_LIBS) $(GLU_LIBS) $(X_LIBS) xineplug_vo_out_opengl_la_LDFLAGS = -avoid-version -module xineplug_vo_out_syncfb_la_SOURCES = alphablend.c video_out_syncfb.c diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c index 74bc39775..8a2993de9 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.3 2002/01/23 15:05:46 richwareham Exp $ + * $Id: video_out_opengl.c,v 1.4 2002/01/23 23:27:10 f1rmb Exp $ * * video_out_glut.c, glut based OpenGL rendering interface for xine * Matthias Hopf @@ -71,7 +71,13 @@ #include #include +#ifdef HAVE_GLUT #include +#else +#ifdef HAVE_GLU +#include +#endif +#endif #include #include @@ -664,6 +670,7 @@ static void opengl_render_image (opengl_driver_t *this, opengl_frame_t *frame, (GLfloat)(this->window_width)/ (GLfloat)(this->window_height), 1.0f, 1000.0f); + glMatrixMode (GL_MODELVIEW); glLoadIdentity (); @@ -937,7 +944,7 @@ static int opengl_gui_data_exchange (vo_driver_t *this_gen, switch (data_type) { case GUI_SELECT_VISUAL: -/*fprintf (stderr, "*** gui_select_visual ***\n"); */ +fprintf (stderr, "*** gui_select_visual ***\n"); XLockDisplay (this->display); this->vinfo = glXChooseVisual (this->display, this->screen, glxAttrib); XUnlockDisplay (this->display); -- cgit v1.2.3