1 #ifndef EGLDISPLAY_INCLUDED
2 #define EGLDISPLAY_INCLUDED
8 #include "egltypedefs.h"
14 EGLNativeDisplayType NativeDisplay
;
17 const char *DriverName
;
18 const char *DriverArgs
;
22 _EGLScreen
**Screens
; /* array [NumScreens] */
25 _EGLConfig
**Configs
; /* array [NumConfigs] of ptr to _EGLConfig */
27 /* lists of linked contexts and surface */
28 _EGLContext
*ContextList
;
29 _EGLSurface
*SurfaceList
;
31 /* hash table to map surfaces to handles */
32 _EGLHashtable
*SurfaceHash
;
34 #ifdef _EGL_PLATFORM_X
41 _eglNewDisplay(NativeDisplayType displayName
);
45 _eglLinkDisplay(_EGLDisplay
*dpy
);
49 _eglUnlinkDisplay(_EGLDisplay
*dpy
);
53 _eglGetDisplayHandle(_EGLDisplay
*display
);
57 _eglLookupDisplay(EGLDisplay dpy
);
61 * Return true if the display is linked.
63 static INLINE EGLBoolean
64 _eglIsDisplayLinked(_EGLDisplay
*dpy
)
66 return (EGLBoolean
) (_eglGetDisplayHandle(dpy
) != EGL_NO_DISPLAY
);
71 _eglFindDisplay(NativeDisplayType nativeDisplay
);
75 _eglReleaseDisplayResources(_EGLDriver
*drv
, EGLDisplay dpy
);
79 _eglCleanupDisplay(_EGLDisplay
*disp
);
83 _eglLinkContext(_EGLContext
*ctx
, _EGLDisplay
*dpy
);
87 _eglUnlinkContext(_EGLContext
*ctx
);
91 _eglGetContextHandle(_EGLContext
*ctx
);
95 _eglLookupContext(EGLContext ctx
);
99 * Return true if the context is linked to a display.
101 static INLINE EGLBoolean
102 _eglIsContextLinked(_EGLContext
*ctx
)
104 return (EGLBoolean
) (_eglGetContextHandle(ctx
) != EGL_NO_CONTEXT
);
108 _eglLinkSurface(_EGLSurface
*surf
, _EGLDisplay
*dpy
);
112 _eglUnlinkSurface(_EGLSurface
*surf
);
116 _eglGetSurfaceHandle(_EGLSurface
*);
120 _eglLookupSurface(EGLSurface surf
);
124 * Return true if the surface is linked to a display.
126 static INLINE EGLBoolean
127 _eglIsSurfaceLinked(_EGLSurface
*surf
)
129 return (EGLBoolean
) (_eglGetSurfaceHandle(surf
) != EGL_NO_SURFACE
);
134 * Cast an unsigned int to a pointer.
137 _eglUIntToPointer(unsigned int v
)
139 return (void *) ((uintptr_t) v
);
144 * Cast a pointer to an unsigned int. The pointer must be one that is
145 * returned by _eglUIntToPointer.
147 static INLINE
unsigned int
148 _eglPointerToUInt(const void *p
)
150 return (unsigned int) ((uintptr_t) p
);
154 #endif /* EGLDISPLAY_INCLUDED */