1 #ifndef EGLDISPLAY_INCLUDED
2 #define EGLDISPLAY_INCLUDED
5 #include "egltypedefs.h"
6 #include "egldefines.h"
10 enum _egl_platform_type
{
11 _EGL_PLATFORM_WINDOWS
,
17 _EGL_INVALID_PLATFORM
= -1
19 typedef enum _egl_platform_type _EGLPlatformType
;
22 enum _egl_resource_type
{
23 _EGL_RESOURCE_CONTEXT
,
24 _EGL_RESOURCE_SURFACE
,
29 /* this cannot and need not go into egltypedefs.h */
30 typedef enum _egl_resource_type _EGLResourceType
;
34 * A resource of a display.
38 /* which display the resource belongs to */
42 /* used to link resources of the same type */
48 * Optional EGL extensions info.
50 struct _egl_extensions
52 EGLBoolean MESA_screen_surface
;
53 EGLBoolean MESA_copy_context
;
54 EGLBoolean MESA_drm_display
;
55 EGLBoolean KHR_image_base
;
56 EGLBoolean KHR_image_pixmap
;
57 EGLBoolean KHR_vg_parent_image
;
58 EGLBoolean KHR_gl_texture_2D_image
;
59 EGLBoolean KHR_gl_texture_cubemap_image
;
60 EGLBoolean KHR_gl_texture_3D_image
;
61 EGLBoolean KHR_gl_renderbuffer_image
;
62 EGLBoolean NOK_swap_region
;
63 EGLBoolean NOK_texture_from_pixmap
;
65 char String
[_EGL_MAX_EXTENSIONS_LEN
];
71 /* used to link displays */
76 _EGLPlatformType Platform
;
77 void *PlatformDisplay
;
79 EGLBoolean Initialized
; /**< True if the display is initialized */
81 void *DriverData
; /* private to driver */
83 int APImajor
, APIminor
; /**< as returned by eglInitialize() */
84 char Version
[1000]; /**< initialized from APImajor/minor, DriverName */
86 /** Bitmask of supported APIs (EGL_xx_BIT) set by the driver during init */
87 EGLint ClientAPIsMask
;
88 char ClientAPIs
[1000]; /**< updated by eglQueryString */
90 _EGLExtensions Extensions
;
93 _EGLScreen
**Screens
; /* array [NumScreens] */
97 _EGLConfig
**Configs
; /* array [NumConfigs] of ptr to _EGLConfig */
99 /* lists of resources */
100 _EGLResource
*ResourceLists
[_EGL_NUM_RESOURCES
];
105 _eglFiniDisplay(void);
109 _eglFindDisplay(_EGLPlatformType plat
, void *plat_dpy
);
113 _eglReleaseDisplayResources(_EGLDriver
*drv
, _EGLDisplay
*dpy
);
117 _eglCleanupDisplay(_EGLDisplay
*disp
);
121 _eglCheckDisplayHandle(EGLDisplay dpy
);
125 _eglCheckResource(void *res
, _EGLResourceType type
, _EGLDisplay
*dpy
);
129 * Lookup a handle to find the linked display.
130 * Return NULL if the handle has no corresponding linked display.
132 static INLINE _EGLDisplay
*
133 _eglLookupDisplay(EGLDisplay display
)
135 _EGLDisplay
*dpy
= (_EGLDisplay
*) display
;
136 if (!_eglCheckDisplayHandle(display
))
143 * Return the handle of a linked display, or EGL_NO_DISPLAY.
145 static INLINE EGLDisplay
146 _eglGetDisplayHandle(_EGLDisplay
*dpy
)
148 return (EGLDisplay
) ((dpy
) ? dpy
: EGL_NO_DISPLAY
);
153 _eglLinkResource(_EGLResource
*res
, _EGLResourceType type
, _EGLDisplay
*dpy
);
157 _eglUnlinkResource(_EGLResource
*res
, _EGLResourceType type
);
161 * Return true if the resource is linked.
163 static INLINE EGLBoolean
164 _eglIsResourceLinked(_EGLResource
*res
)
166 return res
->IsLinked
;
170 #endif /* EGLDISPLAY_INCLUDED */