Merge branch 'mesa_7_5_branch'
[mesa.git] / src / egl / main / egldisplay.h
1 #ifndef EGLDISPLAY_INCLUDED
2 #define EGLDISPLAY_INCLUDED
3
4 #ifdef _EGL_PLATFORM_X
5 #include <X11/Xlib.h>
6 #endif
7
8 #include "egltypedefs.h"
9
10
11 struct _egl_display
12 {
13 EGLNativeDisplayType NativeDisplay;
14 EGLDisplay Handle;
15
16 const char *DriverName;
17 const char *DriverArgs;
18 _EGLDriver *Driver;
19
20 EGLint NumScreens;
21 _EGLScreen **Screens; /* array [NumScreens] */
22
23 EGLint NumConfigs;
24 _EGLConfig **Configs; /* array [NumConfigs] of ptr to _EGLConfig */
25
26 /* lists of linked contexts and surface */
27 _EGLContext *ContextList;
28 _EGLSurface *SurfaceList;
29 #ifdef _EGL_PLATFORM_X
30 Display *Xdpy;
31 #endif
32 };
33
34
35 extern _EGLDisplay *
36 _eglNewDisplay(NativeDisplayType displayName);
37
38
39 extern EGLDisplay
40 _eglLinkDisplay(_EGLDisplay *dpy);
41
42
43 extern void
44 _eglUnlinkDisplay(_EGLDisplay *dpy);
45
46
47 extern EGLDisplay
48 _eglGetDisplayHandle(_EGLDisplay *display);
49
50
51 extern _EGLDisplay *
52 _eglLookupDisplay(EGLDisplay dpy);
53
54
55 /**
56 * Return true if the display is linked.
57 */
58 static INLINE EGLBoolean
59 _eglIsDisplayLinked(_EGLDisplay *dpy)
60 {
61 return (EGLBoolean) (_eglGetDisplayHandle(dpy) != EGL_NO_DISPLAY);
62 }
63
64
65 extern _EGLDisplay *
66 _eglFindDisplay(NativeDisplayType nativeDisplay);
67
68
69 extern void
70 _eglReleaseDisplayResources(_EGLDriver *drv, EGLDisplay dpy);
71
72
73 extern void
74 _eglCleanupDisplay(_EGLDisplay *disp);
75
76
77 extern EGLContext
78 _eglLinkContext(_EGLContext *ctx, _EGLDisplay *dpy);
79
80
81 extern void
82 _eglUnlinkContext(_EGLContext *ctx);
83
84
85 extern EGLContext
86 _eglGetContextHandle(_EGLContext *ctx);
87
88
89 extern _EGLContext *
90 _eglLookupContext(EGLContext ctx);
91
92
93 /**
94 * Return true if the context is linked to a display.
95 */
96 static INLINE EGLBoolean
97 _eglIsContextLinked(_EGLContext *ctx)
98 {
99 return (EGLBoolean) (_eglGetContextHandle(ctx) != EGL_NO_CONTEXT);
100 }
101
102 extern EGLSurface
103 _eglLinkSurface(_EGLSurface *surf, _EGLDisplay *dpy);
104
105
106 extern void
107 _eglUnlinkSurface(_EGLSurface *surf);
108
109
110 extern EGLSurface
111 _eglGetSurfaceHandle(_EGLSurface *);
112
113
114 extern _EGLSurface *
115 _eglLookupSurface(EGLSurface surf);
116
117
118 /**
119 * Return true if the surface is linked to a display.
120 */
121 static INLINE EGLBoolean
122 _eglIsSurfaceLinked(_EGLSurface *surf)
123 {
124 return (EGLBoolean) (_eglGetSurfaceHandle(surf) != EGL_NO_SURFACE);
125 }
126
127
128 #endif /* EGLDISPLAY_INCLUDED */