#ifdef HAVE_X11_PLATFORM
static EGLBoolean
-_eglParseX11DisplayAttribList(const EGLint *attrib_list)
+_eglParseX11DisplayAttribList(_EGLDisplay *display, const EGLint *attrib_list)
{
int i;
/* EGL_EXT_platform_x11 recognizes exactly one attribute,
* EGL_PLATFORM_X11_SCREEN_EXT, which is optional.
- *
- * Mesa supports connecting to only the default screen, so we reject
- * screen != 0.
*/
- if (attrib != EGL_PLATFORM_X11_SCREEN_EXT || value != 0) {
+ if (attrib == EGL_PLATFORM_X11_SCREEN_EXT) {
+ display->Options.Platform = (void *)value;
+ } else {
_eglError(EGL_BAD_ATTRIBUTE, "eglGetPlatformDisplay");
return EGL_FALSE;
}
_eglGetX11Display(Display *native_display,
const EGLint *attrib_list)
{
- if (!_eglParseX11DisplayAttribList(attrib_list)) {
+ _EGLDisplay *display = _eglFindDisplay(_EGL_PLATFORM_X11,
+ native_display);
+
+ if (!display)
+ _eglError(EGL_BAD_ALLOC, "eglGetPlatformDisplay");
+
+ if (!_eglParseX11DisplayAttribList(display, attrib_list)) {
return NULL;
}
- return _eglFindDisplay(_EGL_PLATFORM_X11, native_display);
+ return display;
}
#endif /* HAVE_X11_PLATFORM */
struct {
EGLBoolean TestOnly; /**< Driver should not set fields when true */
EGLBoolean UseFallback; /**< Use fallback driver (sw or less features) */
+ void *Platform; /**< Platform-specific options */
} Options;
/* these fields are set by the driver during init */