x11: Fix build with EGL_NO_PLATFORM_SPECIFIC_TYPES
eglCreateWindowSurface() wants a Window (unsigned long), but with EGL_NO_PLATFORM_SPECIFIC_TYPES, EGLNativeWindowType is defined as an opaque pointer, i.e. void*. BUG: 440372
This commit is contained in:
parent
e10f2ce06e
commit
839710201c
1 changed files with 7 additions and 6 deletions
|
@ -213,15 +213,16 @@ EGLSurface EglOnXBackend::createSurface(xcb_window_t window)
|
||||||
return EGL_NO_SURFACE;
|
return EGL_NO_SURFACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Window is 64 bits on a 64-bit architecture whereas xcb_window_t is always 32 bits.
|
||||||
|
unsigned long nativeWindow = window;
|
||||||
|
|
||||||
EGLSurface surface = EGL_NO_SURFACE;
|
EGLSurface surface = EGL_NO_SURFACE;
|
||||||
if (havePlatformBase()) {
|
if (havePlatformBase()) {
|
||||||
// Note: Window is 64 bits on a 64-bit architecture whereas xcb_window_t is
|
// eglCreatePlatformWindowSurfaceEXT() expects a pointer to the Window.
|
||||||
// always 32 bits. eglCreatePlatformWindowSurfaceEXT() expects the
|
surface = eglCreatePlatformWindowSurfaceEXT(eglDisplay(), config(), (void *) &nativeWindow, nullptr);
|
||||||
// native_window parameter to be pointer to a Window, so this variable
|
|
||||||
// cannot be an xcb_window_t.
|
|
||||||
surface = eglCreatePlatformWindowSurfaceEXT(eglDisplay(), config(), (void *) &window, nullptr);
|
|
||||||
} else {
|
} else {
|
||||||
surface = eglCreateWindowSurface(eglDisplay(), config(), window, nullptr);
|
// eglCreateWindowSurface() expects a Window, not a pointer to the Window.
|
||||||
|
surface = eglCreateWindowSurface(eglDisplay(), config(), reinterpret_cast<EGLNativeWindowType>(nativeWindow), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return surface;
|
return surface;
|
||||||
|
|
Loading…
Reference in a new issue