EGL: use eglGetPlatformDisplay if available (#865)
POSIX Ports: When acquiring an EGL context, try calling the client-specific eglGetPlatformDisplay() before falling back to the more generic eglGetDisplay(). Hopefully fixes #864.
This commit is contained in:
parent
2c7fac57ff
commit
1192bf6f2c
|
@ -46,7 +46,17 @@ static bool __egl_initOpenGL(const int requestedAPI, const int requestedProfile,
|
||||||
EGLint eglMajorVersion;
|
EGLint eglMajorVersion;
|
||||||
EGLint eglMinorVersion;
|
EGLint eglMinorVersion;
|
||||||
|
|
||||||
|
EGLAttrib displayAttr[] = {EGL_NONE};
|
||||||
|
currDisplay = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, EGL_DEFAULT_DISPLAY, displayAttr);
|
||||||
|
if(currDisplay == EGL_NO_DISPLAY)
|
||||||
|
currDisplay = eglGetPlatformDisplay(EGL_PLATFORM_XCB_EXT, EGL_DEFAULT_DISPLAY, displayAttr);
|
||||||
|
if(currDisplay == EGL_NO_DISPLAY)
|
||||||
currDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
currDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||||
|
if(currDisplay == EGL_NO_DISPLAY)
|
||||||
|
{
|
||||||
|
puts("EGL: failed to obtain display handle");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (eglInitialize(currDisplay, &eglMajorVersion, &eglMinorVersion) == EGL_FALSE)
|
if (eglInitialize(currDisplay, &eglMajorVersion, &eglMinorVersion) == EGL_FALSE)
|
||||||
{
|
{
|
||||||
puts("EGL: eglInitialize failed");
|
puts("EGL: eglInitialize failed");
|
||||||
|
|
Loading…
Reference in New Issue