Module: wine Branch: master Commit: ea522c613596afce654ae92faa97aae39562a1ca URL: https://gitlab.winehq.org/wine/wine/-/commit/ea522c613596afce654ae92faa97aae...
Author: Alexandros Frantzis alexandros.frantzis@collabora.com Date: Wed Sep 29 14:30:53 2021 +0300
winewayland.drv: Initialize core GL functions.
---
dlls/winewayland.drv/opengl.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/dlls/winewayland.drv/opengl.c b/dlls/winewayland.drv/opengl.c index 765855e3944..38bc6704128 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 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: