Add EGL-based backend for wxGLCanvas

Among other things, this enables wxGLCanvas to be used natively on
Wayland.

Closes https://github.com/wxWidgets/wxWidgets/pull/2038

Closes #17702.
This commit is contained in:
Scott Talbert
2020-08-28 11:59:27 -04:00
committed by Vadim Zeitlin
parent ed4b9e5f97
commit 7cd12a2bd6
23 changed files with 1101 additions and 31 deletions

104
configure vendored
View File

@@ -953,6 +953,8 @@ CXXFLAGS_VISIBILITY
CFLAGS_VISIBILITY
MesaGL_LIBS
MesaGL_CFLAGS
EGL_LIBS
EGL_CFLAGS
GLU_LIBS
GLU_CFLAGS
GL_LIBS
@@ -1029,7 +1031,6 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -1398,6 +1399,8 @@ GL_CFLAGS
GL_LIBS
GLU_CFLAGS
GLU_LIBS
EGL_CFLAGS
EGL_LIBS
MesaGL_CFLAGS
MesaGL_LIBS
LIBSECRET_CFLAGS
@@ -1458,7 +1461,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1711,15 +1713,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1857,7 +1850,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -2010,7 +2003,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -2413,6 +2405,8 @@ Some influential environment variables:
GL_LIBS linker flags for GL, overriding pkg-config
GLU_CFLAGS C compiler flags for GLU, overriding pkg-config
GLU_LIBS linker flags for GLU, overriding pkg-config
EGL_CFLAGS C compiler flags for EGL, overriding pkg-config
EGL_LIBS linker flags for EGL, overriding pkg-config
MesaGL_CFLAGS
C compiler flags for MesaGL, overriding pkg-config
MesaGL_LIBS linker flags for MesaGL, overriding pkg-config
@@ -28269,6 +28263,90 @@ fi
found_gl=1
OPENGL_LIBS="-lGL -lGLU"
if test "$WXGTK3" = 1; then
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGL" >&5
$as_echo_n "checking for EGL... " >&6; }
if test -n "$PKG_CONFIG"; then
if test -n "$EGL_CFLAGS"; then
pkg_cv_EGL_CFLAGS="$EGL_CFLAGS"
else
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"egl >= 1.5\""; } >&5
($PKG_CONFIG --exists --print-errors "egl >= 1.5") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_EGL_CFLAGS=`$PKG_CONFIG --cflags "egl >= 1.5" 2>/dev/null`
else
pkg_failed=yes
fi
fi
else
pkg_failed=untried
fi
if test -n "$PKG_CONFIG"; then
if test -n "$EGL_LIBS"; then
pkg_cv_EGL_LIBS="$EGL_LIBS"
else
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"egl >= 1.5\""; } >&5
($PKG_CONFIG --exists --print-errors "egl >= 1.5") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_EGL_LIBS=`$PKG_CONFIG --libs "egl >= 1.5" 2>/dev/null`
else
pkg_failed=yes
fi
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
EGL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "egl >= 1.5"`
else
EGL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "egl >= 1.5"`
fi
# Put the nasty error message in config.log where it belongs
echo "$EGL_PKG_ERRORS" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: EGL 1.5+ not available. Will use GLX." >&5
$as_echo "$as_me: EGL 1.5+ not available. Will use GLX." >&6;}
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: EGL 1.5+ not available. Will use GLX." >&5
$as_echo "$as_me: EGL 1.5+ not available. Will use GLX." >&6;}
else
EGL_CFLAGS=$pkg_cv_EGL_CFLAGS
EGL_LIBS=$pkg_cv_EGL_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
OPENGL_LIBS="$OPENGL_LIBS $EGL_LIBS"
$as_echo "#define wxUSE_GLCANVAS_EGL 1" >>confdefs.h
fi
fi
fi
fi