Tizen 2.1 base
[sdk/emulator/qemu.git] / gl / dgles2 / src / EGL / hglx.h
1 /* Copyright (C) 2010  Nokia Corporation All Rights Reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a
4  * copy of this software and associated documentation files (the "Software"),
5  * to deal in the Software without restriction, including without limitation
6  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7  * and/or sell copies of the Software, and to permit persons to whom the
8  * Software is furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included
11  * in all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
16  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
17  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20
21 #ifndef HGLX_H_
22 #define HGLX_H_
23
24 #include <GL/glx.h>
25
26 #define HGLX_FUNCS \
27         HGLX_FUNC(GLXFBConfig*, ChooseFBConfig, (Display *dpy, int screen, const int *attribList, int *nitems)) \
28         HGLX_FUNC(int, GetFBConfigAttrib, (Display *dpy, GLXFBConfig config, int attribute, int *value)) \
29         HGLX_FUNC(GLXFBConfig*, GetFBConfigs, (Display *dpy, int screen, int *nelements)) \
30         HGLX_FUNC(GLXWindow, CreateWindow, (Display *dpy, GLXFBConfig config, Window win, const int *attribList)) \
31         HGLX_FUNC(void, DestroyWindow, (Display *dpy, GLXWindow win)) \
32         HGLX_FUNC(GLXContext, CreateNewContext, (Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct)) \
33         HGLX_FUNC(void, DestroyContext, (Display *dpy, GLXContext ctx)) \
34         HGLX_FUNC(Bool, MakeContextCurrent, (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx)) \
35         HGLX_FUNC(void, SwapBuffers, (Display *dpy, GLXDrawable drawable)) \
36         HGLX_FUNC(int, QueryDrawable, (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value)) \
37         HGLX_FUNC(const char*, QueryServerString, (Display *dpy, int screen, int name)) \
38         HGLX_FUNC(const char*, GetClientString, (Display *dpy, int name)) \
39         HGLX_FUNC(Bool, QueryExtension, (Display *dpy, int *error_base, int *event_base)) \
40         HGLX_FUNC(Bool, QueryVersion, (Display *dpy, int *major, int *minor)) \
41         HGLX_FUNC(GLXPbuffer, CreatePbuffer, (Display* dpy, GLXFBConfig config, const int* attrib_list)) \
42         HGLX_FUNC(void, DestroyPbuffer, (Display* dpy, GLXPbuffer pbuf)) \
43         HGLX_FUNC(GLXPixmap, CreatePixmap, (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list)) \
44         HGLX_FUNC(void, DestroyPixmap, (Display *dpy, GLXPixmap pixmap)) \
45         HGLX_FUNC(XVisualInfo *, GetVisualFromFBConfig, (Display *dpy, GLXFBConfig config)) \
46         HGLX_FUNC(void, WaitGL, (void)) \
47         HGLX_FUNC(void, WaitX, (void)) \
48         HGLX_FUNC(void, BindTexImageEXT, (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list)) \
49         HGLX_FUNC(void, ReleaseTexImageEXT, (Display *dpy, GLXDrawable drawable, int buffer))
50
51 typedef struct HGLX
52 {
53 #define HGLX_FUNC(ret, name, attr) ret (*name) attr;
54         HGLX_FUNCS
55 #undef HGLX_FUNC
56 } HGLX;
57
58 extern HGLX hglX;
59
60 extern int hglXLoad();
61
62 #endif // HGLX_H_