summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2002-01-23 23:27:10 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2002-01-23 23:27:10 +0000
commit6f8315d8f65066fda4ca9498f5d7beec46729d11 (patch)
tree09492f88f47c35a86dbb6f2eb07eec2ff0e46439
parentcb0c0151971264dc780f0ec67571ebb79865496a (diff)
downloadxine-lib-6f8315d8f65066fda4ca9498f5d7beec46729d11.tar.gz
xine-lib-6f8315d8f65066fda4ca9498f5d7beec46729d11.tar.bz2
Change/fix opengl checks, add a glut fallback (GLU).
CVS patchset: 1445 CVS date: 2002/01/23 23:27:10
-rw-r--r--acconfig.h3
-rw-r--r--configure.in37
-rw-r--r--src/video_out/Makefile.am2
-rw-r--r--src/video_out/video_out_opengl.c11
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 <mat@mshopf.de>
@@ -71,7 +71,13 @@
#include <GL/gl.h>
#include <GL/glx.h>
+#ifdef HAVE_GLUT
#include <GL/glut.h>
+#else
+#ifdef HAVE_GLU
+#include <GL/glu.h>
+#endif
+#endif
#include <sys/ipc.h>
#include <sys/shm.h>
@@ -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);