This commit adds support for temporary desync in netplay. When frontend
features that can't be truly synced, in particular rewind, are used,
netplay is momentarily disabled. As soon as the feature finished, e.g. a
rewind ending, netplay resumes with a state load. For rewind, netplay
peers won't actually experience the effect of rewind, but they will load
the rewound state.
Add #ifdefs for EGL_VERSION_1_5 and EGL_EXT_platform_base around the calls to
eglGetPlatformDisplay and eglGetPlatformDisplayEXT, respectively.
This avoids compiler errors when the EGL header files don't have the necessary
declarations for EGL 1.5 or EGL_EXT_platform_base.
Follow-up fix for https://github.com/libretro/RetroArch/issues/4790
Added a platform parameter to egl_init_context. If the caller provides a
platform other than EGL_NONE, then it will try to use eglGetPlatformDisplay or
eglGetPlatformDisplayEXT instead of eglGetDisplay.
If neither eglGetPlatformDisplay or eglGetPlatformDisplayEXT is supported, then
it will still fall back to calling eglGetDisplay.
Updated the Wayland, X11, and DRM callers to use the correct platform enum.
Those are the callers that don't just pass EGL_DEFAULT_DISPLAY as the native
display handle.
Calling eglGetDisplay with any value other than EGL_DEFAULT_DISPLAY is
inherently unreliable, because it requires the EGL implementation to guess a
platform type based on a (void *) pointer. Some implementations might not
identify a particular platform, or worse, might guess wrong.
Fixes https://github.com/libretro/RetroArch/issues/4790