1 #ifndef EGLDISPLAY_INCLUDED
2 #define EGLDISPLAY_INCLUDED
4 #include "egltypedefs.h"
5 #include "egldefines.h"
9 * Optional EGL extensions info.
11 struct _egl_extensions
13 EGLBoolean MESA_screen_surface
;
14 EGLBoolean MESA_copy_context
;
16 char String
[_EGL_MAX_EXTENSIONS_LEN
];
22 /* used to link displays */
25 EGLNativeDisplayType NativeDisplay
;
28 void *DriverData
; /* private to driver */
30 int APImajor
, APIminor
; /**< as returned by eglInitialize() */
31 char Version
[1000]; /**< initialized from APImajor/minor, DriverName */
33 /** Bitmask of supported APIs (EGL_xx_BIT) set by the driver during init */
34 EGLint ClientAPIsMask
;
35 char ClientAPIs
[1000]; /**< updated by eglQueryString */
37 _EGLExtensions Extensions
;
42 _EGLScreen
**Screens
; /* array [NumScreens] */
46 _EGLConfig
**Configs
; /* array [NumConfigs] of ptr to _EGLConfig */
48 /* lists of linked contexts and surface */
49 _EGLContext
*ContextList
;
50 _EGLSurface
*SurfaceList
;
55 _eglFiniDisplay(void);
59 _eglNewDisplay(NativeDisplayType displayName
);
63 _eglLinkDisplay(_EGLDisplay
*dpy
);
67 _eglUnlinkDisplay(_EGLDisplay
*dpy
);
71 _eglFindDisplay(NativeDisplayType nativeDisplay
);
75 _eglReleaseDisplayResources(_EGLDriver
*drv
, _EGLDisplay
*dpy
);
79 _eglCleanupDisplay(_EGLDisplay
*disp
);
82 #ifndef _EGL_SKIP_HANDLE_CHECK
86 _eglCheckDisplayHandle(EGLDisplay dpy
);
89 #else /* !_EGL_SKIP_HANDLE_CHECK */
91 /* Only do a quick check. This is NOT standard compliant. */
93 static INLINE EGLBoolean
94 _eglCheckDisplayHandle(EGLDisplay dpy
)
96 return ((_EGLDisplay
*) dpy
!= NULL
);
100 #endif /* _EGL_SKIP_HANDLE_CHECK */
104 * Lookup a handle to find the linked display.
105 * Return NULL if the handle has no corresponding linked display.
107 static INLINE _EGLDisplay
*
108 _eglLookupDisplay(EGLDisplay display
)
110 _EGLDisplay
*dpy
= (_EGLDisplay
*) display
;
111 if (!_eglCheckDisplayHandle(display
))
118 * Return the handle of a linked display, or EGL_NO_DISPLAY.
120 static INLINE EGLDisplay
121 _eglGetDisplayHandle(_EGLDisplay
*dpy
)
123 return (EGLDisplay
) ((dpy
) ? dpy
: EGL_NO_DISPLAY
);
128 * Return true if the display is linked.
130 static INLINE EGLBoolean
131 _eglIsDisplayLinked(_EGLDisplay
*dpy
)
133 return (EGLBoolean
) (_eglGetDisplayHandle(dpy
) != EGL_NO_DISPLAY
);
138 * Cast an unsigned int to a pointer.
141 _eglUIntToPointer(unsigned int v
)
143 return (void *) ((uintptr_t) v
);
148 * Cast a pointer to an unsigned int. The pointer must be one that is
149 * returned by _eglUIntToPointer.
151 static INLINE
unsigned int
152 _eglPointerToUInt(const void *p
)
154 return (unsigned int) ((uintptr_t) p
);
158 #endif /* EGLDISPLAY_INCLUDED */