DEADSOFTWARE

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