Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
[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 /* The bound status of the context */
19 _EGLThreadInfo *Binding;
20 _EGLSurface *DrawSurface;
21 _EGLSurface *ReadSurface;
22
23 _EGLConfig *Config;
24
25 EGLint ClientAPI; /**< EGL_OPENGL_ES_API, EGL_OPENGL_API, EGL_OPENVG_API */
26 EGLint ClientVersion; /**< 1 = OpenGLES 1.x, 2 = OpenGLES 2.x */
27 };
28
29
30 extern EGLBoolean
31 _eglInitContext(_EGLDriver *drv, _EGLContext *ctx,
32 _EGLConfig *config, const EGLint *attrib_list);
33
34
35 extern _EGLContext *
36 _eglCreateContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, _EGLContext *share_list, const EGLint *attrib_list);
37
38
39 extern EGLBoolean
40 _eglDestroyContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx);
41
42
43 extern EGLBoolean
44 _eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, EGLint attribute, EGLint *value);
45
46
47 extern EGLBoolean
48 _eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *draw, _EGLSurface *read, _EGLContext *ctx);
49
50
51 extern EGLBoolean
52 _eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
53
54
55 /**
56 * Return true if the context is bound to a thread.
57 */
58 static INLINE EGLBoolean
59 _eglIsContextBound(_EGLContext *ctx)
60 {
61 return (ctx->Binding != NULL);
62 }
63
64
65 #endif /* EGLCONTEXT_INCLUDED */