GLStateEGL: Avoid creating two EGLDisplay instances

The current code calls the gladLoadEGLUserPtr() function twice, first to
initialize some basic EGL function pointers so that we can then select
and create an EGLDisplay, and the second time to perform the full
initialization with the created EGLDisplay. This approach ends up
creating two EGL displays (the first internally in glad), which can
cause issues on some platforms.

This commit removes the first call to gladLoadEGLUserPtr(), replacing it
with manual loading of required EGL functions, thus avoiding creating
two EGLDisplays. The EGL functions we load manually are all in EGL 1.0,
so it's safe to use them without any additional version checks.
1 file changed