Path: blob/main/multimedia/bino/files/glew-fix-7098cd6a.patch
18157 views
From 7098cd6afb7ed805de085ed72a5a3ff56e529277 Mon Sep 17 00:00:00 20011From: Martin Lambers <[email protected]>2Date: Sun, 18 Dec 2016 14:37:52 +01003Subject: Revert "Always use GLEWmx, do not fall back to GLEW."45This reverts commit eaf9278782b32a13cea19d1be331cb74a6cddce9.6---7configure.ac | 15 +++++++++++++--8src/Makefile.am | 8 ++++++--9src/video_output.h | 4 +++-10src/video_output_qt.cpp | 13 ++++++++-----11src/video_output_qt.h | 20 +++++++++++++-------125 files changed, 43 insertions(+), 17 deletions(-)1314diff --git a/configure.ac b/configure.ac15index 52181ed..03c6b58 10064416--- configure.ac17+++ configure.ac18@@ -296,7 +296,9 @@ fi19AC_DEFINE_UNQUOTED([HAVE_LIBEQUALIZER], [$HAVE_LIBEQUALIZER], [Have Equalizer?])20AM_CONDITIONAL([HAVE_LIBEQUALIZER], [test "$HAVE_LIBEQUALIZER" = "1"])2122-dnl glewmx23+dnl glew24+dnl With Equalizer, we need glewmx, since that is what Equalizer uses.25+dnl Without Equalizer, glew (without mx) is ok to use, too.26PKG_CHECK_MODULES([libglewmx], [glewmx >= 1.6.0], [HAVE_LIBGLEWMX=1], [HAVE_LIBGLEWMX=0])27if test "$HAVE_LIBGLEWMX" != "1"; then28AC_MSG_WARN([required library libglewmx >= 1.6.0 not found:])29@@ -304,6 +306,15 @@ if test "$HAVE_LIBGLEWMX" != "1"; then30AC_MSG_WARN([libglewmx is provided by glew; Debian package: libglewmx-dev])31fi32AM_CONDITIONAL([HAVE_LIBGLEWMX], [test "$HAVE_LIBGLEWMX" = "1"])33+if test "$HAVE_LIBGLEWMX" != "1" -a "$HAVE_LIBEQUALIZER" != "1"; then34+ AC_MSG_NOTICE([trying to use libglew instead of libglewmx])35+ PKG_CHECK_MODULES([libglew], [glew >= 1.6.0], [HAVE_LIBGLEW=1], [HAVE_LIBGLEW=0])36+ if test "$HAVE_LIBGLEW" != "1"; then37+ AC_MSG_WARN([required library libglew >= 1.6.0 not found:])38+ AC_MSG_WARN([$libglew_PKG_ERRORS])39+ AC_MSG_WARN([libglew is provided by glew; Debian package: libglew-dev])40+ fi41+fi4243dnl libXNVCtrl44AC_ARG_WITH([xnvctrl],45@@ -390,7 +401,7 @@ if test "$am_cv_func_iconv" != "yes" \46-o "$HAVE_LIBASS" != "1" \47-o "$HAVE_LIBOPENAL" != "1" \48-o "$HAVE_LIBQTOPENGL" != "1" \49- -o "$HAVE_LIBGLEWMX" != "1" \50+ -o \( "$HAVE_LIBGLEWMX" != "1" -a "$HAVE_LIBGLEW" != "1" \) \51-o \( "$equalizer" = "yes" -a "$HAVE_LIBEQUALIZER" != "1" \) \52-o \( "$xnvctrl" = "yes" -a "$HAVE_LIBXNVCTRL" != "1" \) \53-o \( "$lirc" = "yes" -a "$HAVE_LIRC" != "1" \) ; then54diff --git a/src/Makefile.am b/src/Makefile.am55index 6fc12bb..65cbae6 10064456--- src/Makefile.am57+++ src/Makefile.am58@@ -149,11 +149,15 @@ DEFS += -DHTMLDIR=\"$(htmldir)\" -DLOCALEDIR=\"$(localedir)\"5960AM_CPPFLAGS = \61$(libavformat_CFLAGS) $(libavdevice_CFLAGS) $(libswscale_CFLAGS) $(libass_CFLAGS) \62- $(libopenal_CFLAGS) $(libgl_CFLAGS) $(libglewmx_CFLAGS) $(libqtopengl_CFLAGS)63+ $(libopenal_CFLAGS) $(libgl_CFLAGS) $(libglewmx_CFLAGS) $(libglew_CFLAGS) $(libqtopengl_CFLAGS)6465bino_LDADD = $(top_builddir)/src/base/libbase.a $(LIBINTL) $(LIBICONV) \66$(libavformat_LIBS) $(libavdevice_LIBS) $(libswscale_LIBS) $(libass_LIBS) \67- $(libopenal_LIBS) $(libgl_LIBS) $(libglewmx_LIBS) $(libqtopengl_LIBS)68+ $(libopenal_LIBS) $(libgl_LIBS) $(libglewmx_LIBS) $(libglew_LIBS) $(libqtopengl_LIBS)69+70+if HAVE_LIBGLEWMX71+AM_CPPFLAGS += -DGLEW_MX72+endif7374if HAVE_LIBEQUALIZER75bino_SOURCES += player_equalizer.h player_equalizer.cpp76diff --git a/src/video_output.h b/src/video_output.h77index 8430ddc..2fd72ce 10064478--- src/video_output.h79+++ src/video_output.h80@@ -1,7 +1,7 @@81/*82* This file is part of bino, a 3D video player.83*84- * Copyright (C) 2010, 2011, 2012, 201585+ * Copyright (C) 2010, 2011, 2012, 2015, 201686* Martin Lambers <[email protected]>87* Frédéric Devernay <[email protected]>88* Joe <[email protected]>89@@ -128,7 +128,9 @@ private:90protected:91subtitle_renderer _subtitle_renderer;9293+#ifdef GLEW_MX94virtual GLEWContext* glewGetContext() const = 0;95+#endif9697// Get the total viewport size.98int full_display_width() const;99diff --git a/src/video_output_qt.cpp b/src/video_output_qt.cpp100index 0758892..ab82388 100644101--- src/video_output_qt.cpp102+++ src/video_output_qt.cpp103@@ -1,7 +1,7 @@104/*105* This file is part of bino, a 3D video player.106*107- * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015108+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016109* Martin Lambers <[email protected]>110* Frédéric Devernay <[email protected]>111* Joe <[email protected]>112@@ -80,11 +80,13 @@ gl_thread::gl_thread(video_output_qt* vo_qt, video_output_qt_widget* vo_qt_widge113{114}115116-#if HAVE_X11117+#ifdef GLEW_MX118+# if HAVE_X11119GLXEWContext* gl_thread::glxewGetContext() const120{121return _vo_qt->glxewGetContext();122}123+# endif124#endif125126void gl_thread::set_render(bool r)127@@ -781,17 +783,18 @@ void video_output_qt::create_widget()128process_events();129}130131-#if HAVE_X11132+#ifdef GLEW_MX133+# if HAVE_X11134GLXEWContext* video_output_qt::glxewGetContext() const135{136return const_cast<GLXEWContext*>(&_glxew_context);137}138-#endif139-140+# endif141GLEWContext* video_output_qt::glewGetContext() const142{143return const_cast<GLEWContext*>(&_glew_context);144}145+#endif146147bool video_output_qt::context_is_stereo() const148{149diff --git a/src/video_output_qt.h b/src/video_output_qt.h150index 1cc3174..089bac9 100644151--- src/video_output_qt.h152+++ src/video_output_qt.h153@@ -1,7 +1,7 @@154/*155* This file is part of bino, a 3D video player.156*157- * Copyright (C) 2010, 2011, 2012, 2013, 2015158+ * Copyright (C) 2010, 2011, 2012, 2013, 2015, 2016159* Martin Lambers <[email protected]>160*161* This program is free software; you can redistribute it and/or modify162@@ -69,8 +69,10 @@ private:163public:164gl_thread(video_output_qt* vo_qt, video_output_qt_widget* vo_qt_widget);165166-#if HAVE_X11167+#ifdef GLEW_MX168+# if HAVE_X11169GLXEWContext* glxewGetContext() const;170+# endif171#endif172173void set_render(bool r);174@@ -166,10 +168,12 @@ protected:175class video_output_qt : public video_output176{177private:178-#if HAVE_X11179+#ifdef GLEW_MX180+# if HAVE_X11181GLXEWContext _glxew_context;182-#endif183+# endif184GLEWContext _glew_context;185+#endif186int _screen_width, _screen_height;187float _screen_pixel_aspect_ratio;188video_container_widget *_container_widget;189@@ -192,10 +196,12 @@ private:190void resume_screensaver();191192protected:193-#if HAVE_X11194- GLXEWContext* glxewGetContext() const;195-#endif196+#ifdef GLEW_MX197+# if HAVE_X11198+ virtual GLXEWContext* glxewGetContext() const;199+# endif200virtual GLEWContext* glewGetContext() const;201+#endif202virtual bool context_is_stereo() const;203virtual void recreate_context(bool stereo);204virtual void trigger_resize(int w, int h);205--206cgit v1.0-41-gc330207208209210