egl: Add funtions to link contexts and surfaces to displays.
[mesa.git] / src / egl / main / eglcontext.h
1
2 #ifndef EGLCONTEXT_INCLUDED
3 #define EGLCONTEXT_INCLUDED
4
5
6 #include "egltypedefs.h"
7
8
9 /**
10 * "Base" class for device driver contexts.
11 */
12 struct _egl_context
13 {
14 /* Managed by EGLDisplay for linking */
15 _EGLDisplay *Display;
16 _EGLContext *Next;
17
18 _EGLConfig *Config;
19
20 _EGLSurface *DrawSurface;
21 _EGLSurface *ReadSurface;
22
23 EGLBoolean IsBound;
24 EGLBoolean DeletePending;
25
26 EGLint ClientAPI; /**< EGL_OPENGL_ES_API, EGL_OPENGL_API, EGL_OPENVG_API */
27 EGLint ClientVersion; /**< 1 = OpenGLES 1.x, 2 = OpenGLES 2.x */
28 };
29
30
31 extern EGLBoolean
32 _eglInitContext(_EGLDriver *drv, EGLDisplay dpy, _EGLContext *ctx,
33 EGLConfig config, const EGLint *attrib_list);
34
35
36 extern void
37 _eglSaveContext(_EGLContext *ctx);
38
39
40 extern void
41 _eglRemoveContext(_EGLContext *ctx);
42
43
44 extern EGLContext
45 _eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
46
47
48 extern EGLBoolean
49 _eglDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx);
50
51
52 extern EGLBoolean
53 _eglQueryContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
54
55
56 extern EGLBoolean
57 _eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
58
59
60 extern EGLBoolean
61 _eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
62
63 #endif /* EGLCONTEXT_INCLUDED */