• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 **
3 ** Copyright 2012, The Android Open Source Project
4 **
5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at
8 **
9 **     http://www.apache.org/licenses/LICENSE-2.0
10 **
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
16 */
17 
18 // This source file is automatically generated
19 
20 package android.opengl;
21 
22 import android.graphics.SurfaceTexture;
23 import android.view.Surface;
24 import android.view.SurfaceView;
25 import android.view.SurfaceHolder;
26 
27 /**
28  * EGL 1.4
29  *
30  */
31 public class EGL14 {
32 
33 public static final int EGL_DEFAULT_DISPLAY            = 0;
34 public static EGLContext EGL_NO_CONTEXT                = null;
35 public static EGLDisplay EGL_NO_DISPLAY                = null;
36 public static EGLSurface EGL_NO_SURFACE                = null;
37 
38 public static final int EGL_FALSE                          = 0;
39 public static final int EGL_TRUE                           = 1;
40 public static final int EGL_SUCCESS                        = 0x3000;
41 public static final int EGL_NOT_INITIALIZED                = 0x3001;
42 public static final int EGL_BAD_ACCESS                     = 0x3002;
43 public static final int EGL_BAD_ALLOC                      = 0x3003;
44 public static final int EGL_BAD_ATTRIBUTE                  = 0x3004;
45 public static final int EGL_BAD_CONFIG                     = 0x3005;
46 public static final int EGL_BAD_CONTEXT                    = 0x3006;
47 public static final int EGL_BAD_CURRENT_SURFACE            = 0x3007;
48 public static final int EGL_BAD_DISPLAY                    = 0x3008;
49 public static final int EGL_BAD_MATCH                      = 0x3009;
50 public static final int EGL_BAD_NATIVE_PIXMAP              = 0x300A;
51 public static final int EGL_BAD_NATIVE_WINDOW              = 0x300B;
52 public static final int EGL_BAD_PARAMETER                  = 0x300C;
53 public static final int EGL_BAD_SURFACE                    = 0x300D;
54 public static final int EGL_CONTEXT_LOST                   = 0x300E;
55 public static final int EGL_BUFFER_SIZE                    = 0x3020;
56 public static final int EGL_ALPHA_SIZE                     = 0x3021;
57 public static final int EGL_BLUE_SIZE                      = 0x3022;
58 public static final int EGL_GREEN_SIZE                     = 0x3023;
59 public static final int EGL_RED_SIZE                       = 0x3024;
60 public static final int EGL_DEPTH_SIZE                     = 0x3025;
61 public static final int EGL_STENCIL_SIZE                   = 0x3026;
62 public static final int EGL_CONFIG_CAVEAT                  = 0x3027;
63 public static final int EGL_CONFIG_ID                      = 0x3028;
64 public static final int EGL_LEVEL                          = 0x3029;
65 public static final int EGL_MAX_PBUFFER_HEIGHT             = 0x302A;
66 public static final int EGL_MAX_PBUFFER_PIXELS             = 0x302B;
67 public static final int EGL_MAX_PBUFFER_WIDTH              = 0x302C;
68 public static final int EGL_NATIVE_RENDERABLE              = 0x302D;
69 public static final int EGL_NATIVE_VISUAL_ID               = 0x302E;
70 public static final int EGL_NATIVE_VISUAL_TYPE             = 0x302F;
71 public static final int EGL_SAMPLES                        = 0x3031;
72 public static final int EGL_SAMPLE_BUFFERS                 = 0x3032;
73 public static final int EGL_SURFACE_TYPE                   = 0x3033;
74 public static final int EGL_TRANSPARENT_TYPE               = 0x3034;
75 public static final int EGL_TRANSPARENT_BLUE_VALUE         = 0x3035;
76 public static final int EGL_TRANSPARENT_GREEN_VALUE        = 0x3036;
77 public static final int EGL_TRANSPARENT_RED_VALUE          = 0x3037;
78 public static final int EGL_NONE                           = 0x3038;
79 public static final int EGL_BIND_TO_TEXTURE_RGB            = 0x3039;
80 public static final int EGL_BIND_TO_TEXTURE_RGBA           = 0x303A;
81 public static final int EGL_MIN_SWAP_INTERVAL              = 0x303B;
82 public static final int EGL_MAX_SWAP_INTERVAL              = 0x303C;
83 public static final int EGL_LUMINANCE_SIZE                 = 0x303D;
84 public static final int EGL_ALPHA_MASK_SIZE                = 0x303E;
85 public static final int EGL_COLOR_BUFFER_TYPE              = 0x303F;
86 public static final int EGL_RENDERABLE_TYPE                = 0x3040;
87 public static final int EGL_MATCH_NATIVE_PIXMAP            = 0x3041;
88 public static final int EGL_CONFORMANT                     = 0x3042;
89 public static final int EGL_SLOW_CONFIG                    = 0x3050;
90 public static final int EGL_NON_CONFORMANT_CONFIG          = 0x3051;
91 public static final int EGL_TRANSPARENT_RGB                = 0x3052;
92 public static final int EGL_RGB_BUFFER                     = 0x308E;
93 public static final int EGL_LUMINANCE_BUFFER               = 0x308F;
94 public static final int EGL_NO_TEXTURE                     = 0x305C;
95 public static final int EGL_TEXTURE_RGB                    = 0x305D;
96 public static final int EGL_TEXTURE_RGBA                   = 0x305E;
97 public static final int EGL_TEXTURE_2D                     = 0x305F;
98 public static final int EGL_PBUFFER_BIT                    = 0x0001;
99 public static final int EGL_PIXMAP_BIT                     = 0x0002;
100 public static final int EGL_WINDOW_BIT                     = 0x0004;
101 public static final int EGL_VG_COLORSPACE_LINEAR_BIT       = 0x0020;
102 public static final int EGL_VG_ALPHA_FORMAT_PRE_BIT        = 0x0040;
103 public static final int EGL_MULTISAMPLE_RESOLVE_BOX_BIT    = 0x0200;
104 public static final int EGL_SWAP_BEHAVIOR_PRESERVED_BIT    = 0x0400;
105 public static final int EGL_OPENGL_ES_BIT                  = 0x0001;
106 public static final int EGL_OPENVG_BIT                     = 0x0002;
107 public static final int EGL_OPENGL_ES2_BIT                 = 0x0004;
108 public static final int EGL_OPENGL_BIT                     = 0x0008;
109 public static final int EGL_VENDOR                         = 0x3053;
110 public static final int EGL_VERSION                        = 0x3054;
111 public static final int EGL_EXTENSIONS                     = 0x3055;
112 public static final int EGL_CLIENT_APIS                    = 0x308D;
113 public static final int EGL_HEIGHT                         = 0x3056;
114 public static final int EGL_WIDTH                          = 0x3057;
115 public static final int EGL_LARGEST_PBUFFER                = 0x3058;
116 public static final int EGL_TEXTURE_FORMAT                 = 0x3080;
117 public static final int EGL_TEXTURE_TARGET                 = 0x3081;
118 public static final int EGL_MIPMAP_TEXTURE                 = 0x3082;
119 public static final int EGL_MIPMAP_LEVEL                   = 0x3083;
120 public static final int EGL_RENDER_BUFFER                  = 0x3086;
121 public static final int EGL_VG_COLORSPACE                  = 0x3087;
122 public static final int EGL_VG_ALPHA_FORMAT                = 0x3088;
123 public static final int EGL_HORIZONTAL_RESOLUTION          = 0x3090;
124 public static final int EGL_VERTICAL_RESOLUTION            = 0x3091;
125 public static final int EGL_PIXEL_ASPECT_RATIO             = 0x3092;
126 public static final int EGL_SWAP_BEHAVIOR                  = 0x3093;
127 public static final int EGL_MULTISAMPLE_RESOLVE            = 0x3099;
128 public static final int EGL_BACK_BUFFER                    = 0x3084;
129 public static final int EGL_SINGLE_BUFFER                  = 0x3085;
130 public static final int EGL_VG_COLORSPACE_sRGB             = 0x3089;
131 public static final int EGL_VG_COLORSPACE_LINEAR           = 0x308A;
132 public static final int EGL_VG_ALPHA_FORMAT_NONPRE         = 0x308B;
133 public static final int EGL_VG_ALPHA_FORMAT_PRE            = 0x308C;
134 public static final int EGL_DISPLAY_SCALING                = 10000;
135 public static final int EGL_BUFFER_PRESERVED               = 0x3094;
136 public static final int EGL_BUFFER_DESTROYED               = 0x3095;
137 public static final int EGL_OPENVG_IMAGE                   = 0x3096;
138 public static final int EGL_CONTEXT_CLIENT_TYPE            = 0x3097;
139 public static final int EGL_CONTEXT_CLIENT_VERSION         = 0x3098;
140 public static final int EGL_MULTISAMPLE_RESOLVE_DEFAULT    = 0x309A;
141 public static final int EGL_MULTISAMPLE_RESOLVE_BOX        = 0x309B;
142 public static final int EGL_OPENGL_ES_API                  = 0x30A0;
143 public static final int EGL_OPENVG_API                     = 0x30A1;
144 public static final int EGL_OPENGL_API                     = 0x30A2;
145 public static final int EGL_DRAW                           = 0x3059;
146 public static final int EGL_READ                           = 0x305A;
147 public static final int EGL_CORE_NATIVE_ENGINE             = 0x305B;
148 
_nativeClassInit()149     native private static void _nativeClassInit();
150     static {
_nativeClassInit()151         _nativeClassInit();
152     }
153     // C function EGLint eglGetError ( void )
154 
eglGetError( )155     public static native int eglGetError(
156     );
157 
158     // C function EGLDisplay eglGetDisplay ( EGLNativeDisplayType display_id )
159 
eglGetDisplay( int display_id )160     public static native EGLDisplay eglGetDisplay(
161         int display_id
162     );
163 
164     // C function EGLBoolean eglInitialize ( EGLDisplay dpy, EGLint *major, EGLint *minor )
165 
eglInitialize( EGLDisplay dpy, int[] major, int majorOffset, int[] minor, int minorOffset )166     public static native boolean eglInitialize(
167         EGLDisplay dpy,
168         int[] major,
169         int majorOffset,
170         int[] minor,
171         int minorOffset
172     );
173 
174     // C function EGLBoolean eglTerminate ( EGLDisplay dpy )
175 
eglTerminate( EGLDisplay dpy )176     public static native boolean eglTerminate(
177         EGLDisplay dpy
178     );
179 
180     // C function const char * eglQueryString ( EGLDisplay dpy, EGLint name )
181 
eglQueryString( EGLDisplay dpy, int name )182     public static native String eglQueryString(
183         EGLDisplay dpy,
184         int name
185     );
186     // C function EGLBoolean eglGetConfigs ( EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config )
187 
eglGetConfigs( EGLDisplay dpy, EGLConfig[] configs, int configsOffset, int config_size, int[] num_config, int num_configOffset )188     public static native boolean eglGetConfigs(
189         EGLDisplay dpy,
190         EGLConfig[] configs,
191         int configsOffset,
192         int config_size,
193         int[] num_config,
194         int num_configOffset
195     );
196 
197     // C function EGLBoolean eglChooseConfig ( EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config )
198 
eglChooseConfig( EGLDisplay dpy, int[] attrib_list, int attrib_listOffset, EGLConfig[] configs, int configsOffset, int config_size, int[] num_config, int num_configOffset )199     public static native boolean eglChooseConfig(
200         EGLDisplay dpy,
201         int[] attrib_list,
202         int attrib_listOffset,
203         EGLConfig[] configs,
204         int configsOffset,
205         int config_size,
206         int[] num_config,
207         int num_configOffset
208     );
209 
210     // C function EGLBoolean eglGetConfigAttrib ( EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value )
211 
eglGetConfigAttrib( EGLDisplay dpy, EGLConfig config, int attribute, int[] value, int offset )212     public static native boolean eglGetConfigAttrib(
213         EGLDisplay dpy,
214         EGLConfig config,
215         int attribute,
216         int[] value,
217         int offset
218     );
219 
220     // C function EGLSurface eglCreateWindowSurface ( EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list )
221 
_eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config, Object win, int[] attrib_list, int offset )222     private static native EGLSurface _eglCreateWindowSurface(
223         EGLDisplay dpy,
224         EGLConfig config,
225         Object win,
226         int[] attrib_list,
227         int offset
228     );
229 
_eglCreateWindowSurfaceTexture( EGLDisplay dpy, EGLConfig config, Object win, int[] attrib_list, int offset )230     private static native EGLSurface _eglCreateWindowSurfaceTexture(
231         EGLDisplay dpy,
232         EGLConfig config,
233         Object win,
234         int[] attrib_list,
235         int offset
236     );
237 
eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, Object win, int[] attrib_list, int offset )238     public static EGLSurface eglCreateWindowSurface(EGLDisplay dpy,
239         EGLConfig config,
240         Object win,
241         int[] attrib_list,
242         int offset
243     ){
244         Surface sur = null;
245         if (win instanceof SurfaceView) {
246             SurfaceView surfaceView = (SurfaceView)win;
247             sur = surfaceView.getHolder().getSurface();
248         } else if (win instanceof SurfaceHolder) {
249             SurfaceHolder holder = (SurfaceHolder)win;
250             sur = holder.getSurface();
251         } else if (win instanceof Surface) {
252             sur = (Surface) win;
253         }
254 
255         EGLSurface surface;
256         if (sur != null) {
257             surface = _eglCreateWindowSurface(dpy, config, sur, attrib_list, offset);
258         } else if (win instanceof SurfaceTexture) {
259             surface = _eglCreateWindowSurfaceTexture(dpy, config,
260                     win, attrib_list, offset);
261         } else {
262             throw new java.lang.UnsupportedOperationException(
263                 "eglCreateWindowSurface() can only be called with an instance of " +
264                 "Surface, SurfaceView, SurfaceTexture or SurfaceHolder at the moment, " +
265                 "this will be fixed later.");
266         }
267 
268         return surface;
269     }
270     // C function EGLSurface eglCreatePbufferSurface ( EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list )
271 
eglCreatePbufferSurface( EGLDisplay dpy, EGLConfig config, int[] attrib_list, int offset )272     public static native EGLSurface eglCreatePbufferSurface(
273         EGLDisplay dpy,
274         EGLConfig config,
275         int[] attrib_list,
276         int offset
277     );
278 
279     // C function EGLSurface eglCreatePixmapSurface ( EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list )
280 
eglCreatePixmapSurface( EGLDisplay dpy, EGLConfig config, int pixmap, int[] attrib_list, int offset )281     public static native EGLSurface eglCreatePixmapSurface(
282         EGLDisplay dpy,
283         EGLConfig config,
284         int pixmap,
285         int[] attrib_list,
286         int offset
287     );
288 
289     // C function EGLBoolean eglDestroySurface ( EGLDisplay dpy, EGLSurface surface )
290 
eglDestroySurface( EGLDisplay dpy, EGLSurface surface )291     public static native boolean eglDestroySurface(
292         EGLDisplay dpy,
293         EGLSurface surface
294     );
295 
296     // C function EGLBoolean eglQuerySurface ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value )
297 
eglQuerySurface( EGLDisplay dpy, EGLSurface surface, int attribute, int[] value, int offset )298     public static native boolean eglQuerySurface(
299         EGLDisplay dpy,
300         EGLSurface surface,
301         int attribute,
302         int[] value,
303         int offset
304     );
305 
306     // C function EGLBoolean eglBindAPI ( EGLenum api )
307 
eglBindAPI( int api )308     public static native boolean eglBindAPI(
309         int api
310     );
311 
312     // C function EGLenum eglQueryAPI ( void )
313 
eglQueryAPI( )314     public static native int eglQueryAPI(
315     );
316 
317     // C function EGLBoolean eglWaitClient ( void )
318 
eglWaitClient( )319     public static native boolean eglWaitClient(
320     );
321 
322     // C function EGLBoolean eglReleaseThread ( void )
323 
eglReleaseThread( )324     public static native boolean eglReleaseThread(
325     );
326 
327     // C function EGLSurface eglCreatePbufferFromClientBuffer ( EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list )
328 
eglCreatePbufferFromClientBuffer( EGLDisplay dpy, int buftype, int buffer, EGLConfig config, int[] attrib_list, int offset )329     public static native EGLSurface eglCreatePbufferFromClientBuffer(
330         EGLDisplay dpy,
331         int buftype,
332         int buffer,
333         EGLConfig config,
334         int[] attrib_list,
335         int offset
336     );
337 
338     // C function EGLBoolean eglSurfaceAttrib ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value )
339 
eglSurfaceAttrib( EGLDisplay dpy, EGLSurface surface, int attribute, int value )340     public static native boolean eglSurfaceAttrib(
341         EGLDisplay dpy,
342         EGLSurface surface,
343         int attribute,
344         int value
345     );
346 
347     // C function EGLBoolean eglBindTexImage ( EGLDisplay dpy, EGLSurface surface, EGLint buffer )
348 
eglBindTexImage( EGLDisplay dpy, EGLSurface surface, int buffer )349     public static native boolean eglBindTexImage(
350         EGLDisplay dpy,
351         EGLSurface surface,
352         int buffer
353     );
354 
355     // C function EGLBoolean eglReleaseTexImage ( EGLDisplay dpy, EGLSurface surface, EGLint buffer )
356 
eglReleaseTexImage( EGLDisplay dpy, EGLSurface surface, int buffer )357     public static native boolean eglReleaseTexImage(
358         EGLDisplay dpy,
359         EGLSurface surface,
360         int buffer
361     );
362 
363     // C function EGLBoolean eglSwapInterval ( EGLDisplay dpy, EGLint interval )
364 
eglSwapInterval( EGLDisplay dpy, int interval )365     public static native boolean eglSwapInterval(
366         EGLDisplay dpy,
367         int interval
368     );
369 
370     // C function EGLContext eglCreateContext ( EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list )
371 
eglCreateContext( EGLDisplay dpy, EGLConfig config, EGLContext share_context, int[] attrib_list, int offset )372     public static native EGLContext eglCreateContext(
373         EGLDisplay dpy,
374         EGLConfig config,
375         EGLContext share_context,
376         int[] attrib_list,
377         int offset
378     );
379 
380     // C function EGLBoolean eglDestroyContext ( EGLDisplay dpy, EGLContext ctx )
381 
eglDestroyContext( EGLDisplay dpy, EGLContext ctx )382     public static native boolean eglDestroyContext(
383         EGLDisplay dpy,
384         EGLContext ctx
385     );
386 
387     // C function EGLBoolean eglMakeCurrent ( EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx )
388 
eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx )389     public static native boolean eglMakeCurrent(
390         EGLDisplay dpy,
391         EGLSurface draw,
392         EGLSurface read,
393         EGLContext ctx
394     );
395 
396     // C function EGLContext eglGetCurrentContext ( void )
397 
eglGetCurrentContext( )398     public static native EGLContext eglGetCurrentContext(
399     );
400 
401     // C function EGLSurface eglGetCurrentSurface ( EGLint readdraw )
402 
eglGetCurrentSurface( int readdraw )403     public static native EGLSurface eglGetCurrentSurface(
404         int readdraw
405     );
406 
407     // C function EGLDisplay eglGetCurrentDisplay ( void )
408 
eglGetCurrentDisplay( )409     public static native EGLDisplay eglGetCurrentDisplay(
410     );
411 
412     // C function EGLBoolean eglQueryContext ( EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value )
413 
eglQueryContext( EGLDisplay dpy, EGLContext ctx, int attribute, int[] value, int offset )414     public static native boolean eglQueryContext(
415         EGLDisplay dpy,
416         EGLContext ctx,
417         int attribute,
418         int[] value,
419         int offset
420     );
421 
422     // C function EGLBoolean eglWaitGL ( void )
423 
eglWaitGL( )424     public static native boolean eglWaitGL(
425     );
426 
427     // C function EGLBoolean eglWaitNative ( EGLint engine )
428 
eglWaitNative( int engine )429     public static native boolean eglWaitNative(
430         int engine
431     );
432 
433     // C function EGLBoolean eglSwapBuffers ( EGLDisplay dpy, EGLSurface surface )
434 
eglSwapBuffers( EGLDisplay dpy, EGLSurface surface )435     public static native boolean eglSwapBuffers(
436         EGLDisplay dpy,
437         EGLSurface surface
438     );
439 
440     // C function EGLBoolean eglCopyBuffers ( EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target )
441 
eglCopyBuffers( EGLDisplay dpy, EGLSurface surface, int target )442     public static native boolean eglCopyBuffers(
443         EGLDisplay dpy,
444         EGLSurface surface,
445         int target
446     );
447 
448 }
449