From: Alexandros Frantzis alexandros.frantzis@collabora.com
--- configure | 2 +- configure.ac | 2 +- dlls/winewayland.drv/opengl.c | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/configure b/configure index 9366b94afb1..aa6e9adac06 100755 --- a/configure +++ b/configure @@ -16235,7 +16235,7 @@ CPPFLAGS=$ac_save_CPPFLAGS
if test "x$with_wayland" != "x" then - if test -z "$SONAME_LIBEGL" + if test -z "$ac_cv_lib_soname_EGL" then : case "x$with_opengl" in x) as_fn_append wine_notices "|EGL ${notice_platform}development files not found, the Wayland driver won't support OpenGL" ;; diff --git a/configure.ac b/configure.ac index 19ce0748d7b..45af0d31daa 100644 --- a/configure.ac +++ b/configure.ac @@ -1384,7 +1384,7 @@ then [WINE_CHECK_SONAME(EGL,eglGetProcAddress,,,[$EGL_LIBS])])]) if test "x$with_wayland" != "x" then - WINE_NOTICE_WITH(opengl, [test -z "$SONAME_LIBEGL"], + WINE_NOTICE_WITH(opengl, [test -z "$ac_cv_lib_soname_EGL"], [EGL ${notice_platform}development files not found, the Wayland driver won't support OpenGL]) fi fi diff --git a/dlls/winewayland.drv/opengl.c b/dlls/winewayland.drv/opengl.c index a4b92233cc8..0b09c62564d 100644 --- a/dlls/winewayland.drv/opengl.c +++ b/dlls/winewayland.drv/opengl.c @@ -45,6 +45,10 @@ static void *egl_handle; static struct opengl_funcs opengl_funcs; static EGLDisplay egl_display;
+#define USE_GL_FUNC(name) #name, +static const char *opengl_func_names[] = { ALL_WGL_FUNCS }; +#undef USE_GL_FUNC + #define DECL_FUNCPTR(f) static __typeof__(f) * p_##f = NULL DECL_FUNCPTR(eglGetError); DECL_FUNCPTR(eglGetPlatformDisplay); @@ -68,6 +72,22 @@ static BOOL has_extension(const char *list, const char *ext) return FALSE; }
+static BOOL init_opengl_funcs(void) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(opengl_func_names); i++) + { + if (!(((void **)&opengl_funcs.gl)[i] = p_eglGetProcAddress(opengl_func_names[i]))) + { + ERR("%s not found, disabling OpenGL.\n", opengl_func_names[i]); + return FALSE; + } + } + + return TRUE; +} + static void init_opengl(void) { EGLint egl_version[2]; @@ -124,6 +144,8 @@ static void init_opengl(void) } TRACE("EGL version %u.%u\n", egl_version[0], egl_version[1]);
+ if (!init_opengl_funcs()) goto err; + return;
err: