1 #ifndef EGLDISPLAY_INCLUDED
2 #define EGLDISPLAY_INCLUDED
8 #include "egltypedefs.h"
10 #include "egldefines.h"
14 * Optional EGL extensions info.
16 struct _egl_extensions
18 EGLBoolean MESA_screen_surface
;
19 EGLBoolean MESA_copy_context
;
21 char String
[_EGL_MAX_EXTENSIONS_LEN
];
27 /* used to link displays */
30 EGLNativeDisplayType NativeDisplay
;
32 const char *DriverName
;
34 void *DriverData
; /* private to driver */
36 int APImajor
, APIminor
; /**< as returned by eglInitialize() */
37 char Version
[1000]; /**< initialized from APImajor/minor, DriverName */
39 /** Bitmask of supported APIs (EGL_xx_BIT) set by the driver during init */
40 EGLint ClientAPIsMask
;
41 char ClientAPIs
[1000]; /**< updated by eglQueryString */
43 _EGLExtensions Extensions
;
48 _EGLScreen
**Screens
; /* array [NumScreens] */
51 _EGLConfig
**Configs
; /* array [NumConfigs] of ptr to _EGLConfig */
53 /* lists of linked contexts and surface */
54 _EGLContext
*ContextList
;
55 _EGLSurface
*SurfaceList
;
57 #ifdef _EGL_PLATFORM_X
64 _eglFiniDisplay(void);
68 _eglNewDisplay(NativeDisplayType displayName
);
72 _eglLinkDisplay(_EGLDisplay
*dpy
);
76 _eglUnlinkDisplay(_EGLDisplay
*dpy
);
80 _eglGetDisplayHandle(_EGLDisplay
*display
);
84 _eglLookupDisplay(EGLDisplay dpy
);
88 * Return true if the display is linked.
90 static INLINE EGLBoolean
91 _eglIsDisplayLinked(_EGLDisplay
*dpy
)
93 return (EGLBoolean
) (_eglGetDisplayHandle(dpy
) != EGL_NO_DISPLAY
);
98 _eglFindDisplay(NativeDisplayType nativeDisplay
);
102 _eglReleaseDisplayResources(_EGLDriver
*drv
, _EGLDisplay
*dpy
);
106 _eglCleanupDisplay(_EGLDisplay
*disp
);
110 _eglLinkContext(_EGLContext
*ctx
, _EGLDisplay
*dpy
);
114 _eglUnlinkContext(_EGLContext
*ctx
);
118 _eglGetContextHandle(_EGLContext
*ctx
);
122 _eglLookupContext(EGLContext ctx
, _EGLDisplay
*dpy
);
126 * Return true if the context is linked to a display.
128 static INLINE EGLBoolean
129 _eglIsContextLinked(_EGLContext
*ctx
)
131 return (EGLBoolean
) (_eglGetContextHandle(ctx
) != EGL_NO_CONTEXT
);
135 _eglLinkSurface(_EGLSurface
*surf
, _EGLDisplay
*dpy
);
139 _eglUnlinkSurface(_EGLSurface
*surf
);
143 _eglGetSurfaceHandle(_EGLSurface
*);
147 _eglLookupSurface(EGLSurface surf
, _EGLDisplay
*dpy
);
151 * Return true if the surface is linked to a display.
153 static INLINE EGLBoolean
154 _eglIsSurfaceLinked(_EGLSurface
*surf
)
156 return (EGLBoolean
) (_eglGetSurfaceHandle(surf
) != EGL_NO_SURFACE
);
161 * Cast an unsigned int to a pointer.
164 _eglUIntToPointer(unsigned int v
)
166 return (void *) ((uintptr_t) v
);
171 * Cast a pointer to an unsigned int. The pointer must be one that is
172 * returned by _eglUIntToPointer.
174 static INLINE
unsigned int
175 _eglPointerToUInt(const void *p
)
177 return (unsigned int) ((uintptr_t) p
);
181 #endif /* EGLDISPLAY_INCLUDED */