DEADSOFTWARE

Initial version
[nanogl.git] / GL / egl.h
1 #ifndef __EGL__H__
2 #define __EGL__H__
6 typedef int EGLBoolean;
7 typedef int EGLint;
8 typedef int EGLDisplay;
9 typedef int EGLConfig;
10 typedef int EGLSurface;
11 typedef int EGLContext;
13 typedef int NativeDisplayType;
14 typedef void* NativeWindowType;
15 typedef void* NativePixmapType;
17 #define EGL_DEFAULT_DISPLAY 0
18 #define EGL_NO_CONTEXT 0
19 #define EGL_NO_DISPLAY 0
20 #define EGL_NO_SURFACE 0
22 /*
23 ** Versioning and extensions
24 */
25 #define EGL_VERSION_1_0 1
26 #define EGL_VERSION_1_1 1
28 /*
29 ** Boolean
30 */
31 #define EGL_FALSE 0
32 #define EGL_TRUE 1
34 /*
35 ** Errors
36 */
37 #define EGL_SUCCESS 0x3000
38 #define EGL_NOT_INITIALIZED 0x3001
39 #define EGL_BAD_ACCESS 0x3002
40 #define EGL_BAD_ALLOC 0x3003
41 #define EGL_BAD_ATTRIBUTE 0x3004
42 #define EGL_BAD_CONFIG 0x3005
43 #define EGL_BAD_CONTEXT 0x3006
44 #define EGL_BAD_CURRENT_SURFACE 0x3007
45 #define EGL_BAD_DISPLAY 0x3008
46 #define EGL_BAD_MATCH 0x3009
47 #define EGL_BAD_NATIVE_PIXMAP 0x300A
48 #define EGL_BAD_NATIVE_WINDOW 0x300B
49 #define EGL_BAD_PARAMETER 0x300C
50 #define EGL_BAD_SURFACE 0x300D
51 #define EGL_CONTEXT_LOST 0x300E
52 /* 0x300F - 0x301F reserved for additional errors. */
54 /*
55 ** Config attributes
56 */
57 #define EGL_BUFFER_SIZE 0x3020
58 #define EGL_ALPHA_SIZE 0x3021
59 #define EGL_BLUE_SIZE 0x3022
60 #define EGL_GREEN_SIZE 0x3023
61 #define EGL_RED_SIZE 0x3024
62 #define EGL_DEPTH_SIZE 0x3025
63 #define EGL_STENCIL_SIZE 0x3026
64 #define EGL_CONFIG_CAVEAT 0x3027
65 #define EGL_CONFIG_ID 0x3028
66 #define EGL_LEVEL 0x3029
67 #define EGL_MAX_PBUFFER_HEIGHT 0x302A
68 #define EGL_MAX_PBUFFER_PIXELS 0x302B
69 #define EGL_MAX_PBUFFER_WIDTH 0x302C
70 #define EGL_NATIVE_RENDERABLE 0x302D
71 #define EGL_NATIVE_VISUAL_ID 0x302E
72 #define EGL_NATIVE_VISUAL_TYPE 0x302F
73 /*#define EGL_PRESERVED_RESOURCES 0x3030*/
74 #define EGL_SAMPLES 0x3031
75 #define EGL_SAMPLE_BUFFERS 0x3032
76 #define EGL_SURFACE_TYPE 0x3033
77 #define EGL_TRANSPARENT_TYPE 0x3034
78 #define EGL_TRANSPARENT_BLUE_VALUE 0x3035
79 #define EGL_TRANSPARENT_GREEN_VALUE 0x3036
80 #define EGL_TRANSPARENT_RED_VALUE 0x3037
82 #define EGL_NONE 0x3038 /* Also a config value */
83 #define EGL_BIND_TO_TEXTURE_RGB 0x3039
84 #define EGL_BIND_TO_TEXTURE_RGBA 0x303A
85 #define EGL_MIN_SWAP_INTERVAL 0x303B
86 #define EGL_MAX_SWAP_INTERVAL 0x303C
88 /*
89 ** Config values
90 */
91 #define EGL_DONT_CARE ((EGLint) -1)
93 #define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
94 #define EGL_NON_CONFORMANT_CONFIG 0x3051 /* " */
95 #define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
96 #define EGL_NO_TEXTURE 0x305C /* EGL_TEXTURE_FORMAT/TARGET value */
97 #define EGL_TEXTURE_RGB 0x305D /* EGL_TEXTURE_FORMAT value */
98 #define EGL_TEXTURE_RGBA 0x305E /* " */
99 #define EGL_TEXTURE_2D 0x305F /* EGL_TEXTURE_TARGET value */
101 /*
102 ** Config attribute mask bits
103 */
104 #define EGL_PBUFFER_BIT 0x01 /* EGL_SURFACE_TYPE mask bit */
105 #define EGL_PIXMAP_BIT 0x02 /* " */
106 #define EGL_WINDOW_BIT 0x04 /* " */
108 /*
109 ** String names
110 */
111 #define EGL_VENDOR 0x3053
112 #define EGL_VERSION 0x3054
113 #define EGL_EXTENSIONS 0x3055
115 /*
116 ** Surface attributes
117 */
118 #define EGL_HEIGHT 0x3056
119 #define EGL_WIDTH 0x3057
120 #define EGL_LARGEST_PBUFFER 0x3058
121 #define EGL_TEXTURE_FORMAT 0x3080 /* For pbuffers bound as textures */
122 #define EGL_TEXTURE_TARGET 0x3081 /* " */
123 #define EGL_MIPMAP_TEXTURE 0x3082 /* " */
124 #define EGL_MIPMAP_LEVEL 0x3083 /* " */
126 /*
127 ** BindTexImage / ReleaseTexImage buffer target
128 */
129 #define EGL_BACK_BUFFER 0x3084
131 /*
132 ** Current surfaces
133 */
134 #define EGL_DRAW 0x3059
135 #define EGL_READ 0x305A
137 /*
138 ** Engines
139 */
140 #define EGL_CORE_NATIVE_ENGINE 0x305B
142 #ifdef __cplusplus
143 extern "C" {
144 #endif
146 EGLint eglGetError (void);
148 EGLDisplay eglGetDisplay (NativeDisplayType display);
149 EGLBoolean eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
150 EGLBoolean eglTerminate (EGLDisplay dpy);
151 const char * eglQueryString (EGLDisplay dpy, EGLint name);
152 //#ifdef __cplusplus
153 //void (* eglGetProcAddress (const char *procname))(...);
154 //#else
155 void * eglGetProcAddress (const char *procname);
156 //#endif
158 EGLBoolean eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
159 EGLBoolean eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
160 EGLBoolean eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
162 EGLSurface eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
163 EGLSurface eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
164 EGLSurface eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
165 EGLBoolean eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
166 EGLBoolean eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
167 /* EGL 1.1 render-to-texture APIs */
168 EGLBoolean eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
169 EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
170 EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
172 /* EGL 1.1 swap control API */
173 EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval);
175 EGLContext eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
176 EGLBoolean eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
177 EGLBoolean eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
178 EGLContext eglGetCurrentContext (void);
179 EGLSurface eglGetCurrentSurface (EGLint readdraw);
180 EGLDisplay eglGetCurrentDisplay (void);
181 EGLBoolean eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
183 EGLBoolean eglWaitGL (void);
184 EGLBoolean eglWaitNative (EGLint engine);
185 EGLBoolean eglSwapBuffers (EGLDisplay dpy, EGLSurface draw);
186 EGLBoolean eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
188 #ifdef __cplusplus
190 #endif
192 #endif /* ___egl_h_ */