1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

winewayland.drv: Initialize core GL functions.

This commit is contained in:
Alexandros Frantzis 2021-09-29 14:30:53 +03:00 committed by Alexandre Julliard
parent aaaac72fdb
commit ea522c6135

View file

@ -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: