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 EGLNativeDisplayType NativeDisplay
;
30 const char *DriverName
;
32 void *DriverData
; /* private to driver */
34 int APImajor
, APIminor
; /**< as returned by eglInitialize() */
35 char Version
[1000]; /**< initialized from APImajor/minor, DriverName */
37 /** Bitmask of supported APIs (EGL_xx_BIT) set by the driver during init */
38 EGLint ClientAPIsMask
;
39 char ClientAPIs
[1000]; /**< updated by eglQueryString */
41 _EGLExtensions Extensions
;
46 _EGLScreen
**Screens
; /* array [NumScreens] */
49 _EGLConfig
**Configs
; /* array [NumConfigs] of ptr to _EGLConfig */
51 /* lists of linked contexts and surface */
52 _EGLContext
*ContextList
;
53 _EGLSurface
*SurfaceList
;
55 /* hash table to map surfaces to handles */
56 _EGLHashtable
*SurfaceHash
;
58 #ifdef _EGL_PLATFORM_X
65 _eglNewDisplay(NativeDisplayType displayName
);
69 _eglLinkDisplay(_EGLDisplay
*dpy
);
73 _eglUnlinkDisplay(_EGLDisplay
*dpy
);
77 _eglGetDisplayHandle(_EGLDisplay
*display
);
81 _eglLookupDisplay(EGLDisplay dpy
);
85 * Return true if the display is linked.
87 static INLINE EGLBoolean
88 _eglIsDisplayLinked(_EGLDisplay
*dpy
)
90 return (EGLBoolean
) (_eglGetDisplayHandle(dpy
) != EGL_NO_DISPLAY
);
95 _eglFindDisplay(NativeDisplayType nativeDisplay
);
99 _eglReleaseDisplayResources(_EGLDriver
*drv
, _EGLDisplay
*dpy
);
103 _eglCleanupDisplay(_EGLDisplay
*disp
);
107 _eglLinkContext(_EGLContext
*ctx
, _EGLDisplay
*dpy
);
111 _eglUnlinkContext(_EGLContext
*ctx
);
115 _eglGetContextHandle(_EGLContext
*ctx
);
119 _eglLookupContext(EGLContext ctx
, _EGLDisplay
*dpy
);
123 * Return true if the context is linked to a display.
125 static INLINE EGLBoolean
126 _eglIsContextLinked(_EGLContext
*ctx
)
128 return (EGLBoolean
) (_eglGetContextHandle(ctx
) != EGL_NO_CONTEXT
);
132 _eglLinkSurface(_EGLSurface
*surf
, _EGLDisplay
*dpy
);
136 _eglUnlinkSurface(_EGLSurface
*surf
);
140 _eglGetSurfaceHandle(_EGLSurface
*);
144 _eglLookupSurface(EGLSurface surf
, _EGLDisplay
*dpy
);
148 * Return true if the surface is linked to a display.
150 static INLINE EGLBoolean
151 _eglIsSurfaceLinked(_EGLSurface
*surf
)
153 return (EGLBoolean
) (_eglGetSurfaceHandle(surf
) != EGL_NO_SURFACE
);
158 * Cast an unsigned int to a pointer.
161 _eglUIntToPointer(unsigned int v
)
163 return (void *) ((uintptr_t) v
);
168 * Cast a pointer to an unsigned int. The pointer must be one that is
169 * returned by _eglUIntToPointer.
171 static INLINE
unsigned int
172 _eglPointerToUInt(const void *p
)
174 return (unsigned int) ((uintptr_t) p
);
178 #endif /* EGLDISPLAY_INCLUDED */