egl: Use the link functions to manage resources.
[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, _EGLContext *ctx,
33 _EGLConfig *config, const EGLint *attrib_list);
34
35
36 extern EGLContext
37 _eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
38
39
40 extern EGLBoolean
41 _eglDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx);
42
43
44 extern EGLBoolean
45 _eglQueryContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
46
47
48 extern EGLBoolean
49 _eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
50
51
52 extern EGLBoolean
53 _eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
54
55 #endif /* EGLCONTEXT_INCLUDED */