Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/multimedia/bino/files/glew-fix-7098cd6a.patch
18157 views
1
From 7098cd6afb7ed805de085ed72a5a3ff56e529277 Mon Sep 17 00:00:00 2001
2
From: Martin Lambers <[email protected]>
3
Date: Sun, 18 Dec 2016 14:37:52 +0100
4
Subject: Revert "Always use GLEWmx, do not fall back to GLEW."
5
6
This reverts commit eaf9278782b32a13cea19d1be331cb74a6cddce9.
7
---
8
configure.ac | 15 +++++++++++++--
9
src/Makefile.am | 8 ++++++--
10
src/video_output.h | 4 +++-
11
src/video_output_qt.cpp | 13 ++++++++-----
12
src/video_output_qt.h | 20 +++++++++++++-------
13
5 files changed, 43 insertions(+), 17 deletions(-)
14
15
diff --git a/configure.ac b/configure.ac
16
index 52181ed..03c6b58 100644
17
--- configure.ac
18
+++ configure.ac
19
@@ -296,7 +296,9 @@ fi
20
AC_DEFINE_UNQUOTED([HAVE_LIBEQUALIZER], [$HAVE_LIBEQUALIZER], [Have Equalizer?])
21
AM_CONDITIONAL([HAVE_LIBEQUALIZER], [test "$HAVE_LIBEQUALIZER" = "1"])
22
23
-dnl glewmx
24
+dnl glew
25
+dnl With Equalizer, we need glewmx, since that is what Equalizer uses.
26
+dnl Without Equalizer, glew (without mx) is ok to use, too.
27
PKG_CHECK_MODULES([libglewmx], [glewmx >= 1.6.0], [HAVE_LIBGLEWMX=1], [HAVE_LIBGLEWMX=0])
28
if test "$HAVE_LIBGLEWMX" != "1"; then
29
AC_MSG_WARN([required library libglewmx >= 1.6.0 not found:])
30
@@ -304,6 +306,15 @@ if test "$HAVE_LIBGLEWMX" != "1"; then
31
AC_MSG_WARN([libglewmx is provided by glew; Debian package: libglewmx-dev])
32
fi
33
AM_CONDITIONAL([HAVE_LIBGLEWMX], [test "$HAVE_LIBGLEWMX" = "1"])
34
+if test "$HAVE_LIBGLEWMX" != "1" -a "$HAVE_LIBEQUALIZER" != "1"; then
35
+ AC_MSG_NOTICE([trying to use libglew instead of libglewmx])
36
+ PKG_CHECK_MODULES([libglew], [glew >= 1.6.0], [HAVE_LIBGLEW=1], [HAVE_LIBGLEW=0])
37
+ if test "$HAVE_LIBGLEW" != "1"; then
38
+ AC_MSG_WARN([required library libglew >= 1.6.0 not found:])
39
+ AC_MSG_WARN([$libglew_PKG_ERRORS])
40
+ AC_MSG_WARN([libglew is provided by glew; Debian package: libglew-dev])
41
+ fi
42
+fi
43
44
dnl libXNVCtrl
45
AC_ARG_WITH([xnvctrl],
46
@@ -390,7 +401,7 @@ if test "$am_cv_func_iconv" != "yes" \
47
-o "$HAVE_LIBASS" != "1" \
48
-o "$HAVE_LIBOPENAL" != "1" \
49
-o "$HAVE_LIBQTOPENGL" != "1" \
50
- -o "$HAVE_LIBGLEWMX" != "1" \
51
+ -o \( "$HAVE_LIBGLEWMX" != "1" -a "$HAVE_LIBGLEW" != "1" \) \
52
-o \( "$equalizer" = "yes" -a "$HAVE_LIBEQUALIZER" != "1" \) \
53
-o \( "$xnvctrl" = "yes" -a "$HAVE_LIBXNVCTRL" != "1" \) \
54
-o \( "$lirc" = "yes" -a "$HAVE_LIRC" != "1" \) ; then
55
diff --git a/src/Makefile.am b/src/Makefile.am
56
index 6fc12bb..65cbae6 100644
57
--- src/Makefile.am
58
+++ src/Makefile.am
59
@@ -149,11 +149,15 @@ DEFS += -DHTMLDIR=\"$(htmldir)\" -DLOCALEDIR=\"$(localedir)\"
60
61
AM_CPPFLAGS = \
62
$(libavformat_CFLAGS) $(libavdevice_CFLAGS) $(libswscale_CFLAGS) $(libass_CFLAGS) \
63
- $(libopenal_CFLAGS) $(libgl_CFLAGS) $(libglewmx_CFLAGS) $(libqtopengl_CFLAGS)
64
+ $(libopenal_CFLAGS) $(libgl_CFLAGS) $(libglewmx_CFLAGS) $(libglew_CFLAGS) $(libqtopengl_CFLAGS)
65
66
bino_LDADD = $(top_builddir)/src/base/libbase.a $(LIBINTL) $(LIBICONV) \
67
$(libavformat_LIBS) $(libavdevice_LIBS) $(libswscale_LIBS) $(libass_LIBS) \
68
- $(libopenal_LIBS) $(libgl_LIBS) $(libglewmx_LIBS) $(libqtopengl_LIBS)
69
+ $(libopenal_LIBS) $(libgl_LIBS) $(libglewmx_LIBS) $(libglew_LIBS) $(libqtopengl_LIBS)
70
+
71
+if HAVE_LIBGLEWMX
72
+AM_CPPFLAGS += -DGLEW_MX
73
+endif
74
75
if HAVE_LIBEQUALIZER
76
bino_SOURCES += player_equalizer.h player_equalizer.cpp
77
diff --git a/src/video_output.h b/src/video_output.h
78
index 8430ddc..2fd72ce 100644
79
--- src/video_output.h
80
+++ src/video_output.h
81
@@ -1,7 +1,7 @@
82
/*
83
* This file is part of bino, a 3D video player.
84
*
85
- * Copyright (C) 2010, 2011, 2012, 2015
86
+ * Copyright (C) 2010, 2011, 2012, 2015, 2016
87
* Martin Lambers <[email protected]>
88
* Frédéric Devernay <[email protected]>
89
* Joe <[email protected]>
90
@@ -128,7 +128,9 @@ private:
91
protected:
92
subtitle_renderer _subtitle_renderer;
93
94
+#ifdef GLEW_MX
95
virtual GLEWContext* glewGetContext() const = 0;
96
+#endif
97
98
// Get the total viewport size.
99
int full_display_width() const;
100
diff --git a/src/video_output_qt.cpp b/src/video_output_qt.cpp
101
index 0758892..ab82388 100644
102
--- src/video_output_qt.cpp
103
+++ src/video_output_qt.cpp
104
@@ -1,7 +1,7 @@
105
/*
106
* This file is part of bino, a 3D video player.
107
*
108
- * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015
109
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016
110
* Martin Lambers <[email protected]>
111
* Frédéric Devernay <[email protected]>
112
* Joe <[email protected]>
113
@@ -80,11 +80,13 @@ gl_thread::gl_thread(video_output_qt* vo_qt, video_output_qt_widget* vo_qt_widge
114
{
115
}
116
117
-#if HAVE_X11
118
+#ifdef GLEW_MX
119
+# if HAVE_X11
120
GLXEWContext* gl_thread::glxewGetContext() const
121
{
122
return _vo_qt->glxewGetContext();
123
}
124
+# endif
125
#endif
126
127
void gl_thread::set_render(bool r)
128
@@ -781,17 +783,18 @@ void video_output_qt::create_widget()
129
process_events();
130
}
131
132
-#if HAVE_X11
133
+#ifdef GLEW_MX
134
+# if HAVE_X11
135
GLXEWContext* video_output_qt::glxewGetContext() const
136
{
137
return const_cast<GLXEWContext*>(&_glxew_context);
138
}
139
-#endif
140
-
141
+# endif
142
GLEWContext* video_output_qt::glewGetContext() const
143
{
144
return const_cast<GLEWContext*>(&_glew_context);
145
}
146
+#endif
147
148
bool video_output_qt::context_is_stereo() const
149
{
150
diff --git a/src/video_output_qt.h b/src/video_output_qt.h
151
index 1cc3174..089bac9 100644
152
--- src/video_output_qt.h
153
+++ src/video_output_qt.h
154
@@ -1,7 +1,7 @@
155
/*
156
* This file is part of bino, a 3D video player.
157
*
158
- * Copyright (C) 2010, 2011, 2012, 2013, 2015
159
+ * Copyright (C) 2010, 2011, 2012, 2013, 2015, 2016
160
* Martin Lambers <[email protected]>
161
*
162
* This program is free software; you can redistribute it and/or modify
163
@@ -69,8 +69,10 @@ private:
164
public:
165
gl_thread(video_output_qt* vo_qt, video_output_qt_widget* vo_qt_widget);
166
167
-#if HAVE_X11
168
+#ifdef GLEW_MX
169
+# if HAVE_X11
170
GLXEWContext* glxewGetContext() const;
171
+# endif
172
#endif
173
174
void set_render(bool r);
175
@@ -166,10 +168,12 @@ protected:
176
class video_output_qt : public video_output
177
{
178
private:
179
-#if HAVE_X11
180
+#ifdef GLEW_MX
181
+# if HAVE_X11
182
GLXEWContext _glxew_context;
183
-#endif
184
+# endif
185
GLEWContext _glew_context;
186
+#endif
187
int _screen_width, _screen_height;
188
float _screen_pixel_aspect_ratio;
189
video_container_widget *_container_widget;
190
@@ -192,10 +196,12 @@ private:
191
void resume_screensaver();
192
193
protected:
194
-#if HAVE_X11
195
- GLXEWContext* glxewGetContext() const;
196
-#endif
197
+#ifdef GLEW_MX
198
+# if HAVE_X11
199
+ virtual GLXEWContext* glxewGetContext() const;
200
+# endif
201
virtual GLEWContext* glewGetContext() const;
202
+#endif
203
virtual bool context_is_stereo() const;
204
virtual void recreate_context(bool stereo);
205
virtual void trigger_resize(int w, int h);
206
--
207
cgit v1.0-41-gc330
208
209
210