egl: Expose eglGetProcAddress

It will be needed for OpenGL ES extension function symbol loading.

https://bugzilla.gnome.org/show_bug.cgi?id=785381
This commit is contained in:
Jonas Ådahl 2017-07-24 17:15:21 +08:00
parent cbcf6a4f23
commit e62cfd9043
2 changed files with 23 additions and 0 deletions

View File

@ -246,6 +246,25 @@ meta_egl_initialize (MetaEgl *egl,
return TRUE; return TRUE;
} }
gpointer
meta_egl_get_proc_address (MetaEgl *egl,
const char *procname,
GError **error)
{
gpointer func;
func = (gpointer) eglGetProcAddress (procname);
if (!func)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Could not load symbol '%s': Not found",
procname);
return NULL;
}
return func;
}
gboolean gboolean
meta_egl_choose_config (MetaEgl *egl, meta_egl_choose_config (MetaEgl *egl,
EGLDisplay display, EGLDisplay display,

View File

@ -52,6 +52,10 @@ gboolean meta_egl_initialize (MetaEgl *egl,
EGLDisplay display, EGLDisplay display,
GError **error); GError **error);
gpointer meta_egl_get_proc_address (MetaEgl *egl,
const char *procname,
GError **error);
gboolean meta_egl_choose_config (MetaEgl *egl, gboolean meta_egl_choose_config (MetaEgl *egl,
EGLDisplay display, EGLDisplay display,
const EGLint *attrib_list, const EGLint *attrib_list,