egl: Add support for querying render buffer.
[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 /* The real render buffer when a window surface is bound */
29 EGLint WindowRenderBuffer;
30 };
31
32
33 extern EGLBoolean
34 _eglInitContext(_EGLDriver *drv, _EGLContext *ctx,
35 _EGLConfig *config, const EGLint *attrib_list);
36
37
38 extern _EGLContext *
39 _eglCreateContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, _EGLContext *share_list, const EGLint *attrib_list);
40
41
42 extern EGLBoolean
43 _eglDestroyContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx);
44
45
46 extern EGLBoolean
47 _eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, EGLint attribute, EGLint *value);
48
49
50 extern EGLBoolean
51 _eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *draw, _EGLSurface *read, _EGLContext *ctx);
52
53
54 extern EGLBoolean
55 _eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
56
57
58 /**
59 * Return true if the context is bound to a thread.
60 */
61 static INLINE EGLBoolean
62 _eglIsContextBound(_EGLContext *ctx)
63 {
64 return (ctx->Binding != NULL);
65 }
66
67
68 #endif /* EGLCONTEXT_INCLUDED */