summaryrefslogtreecommitdiffstats
path: root/opengl/java/android/opengl/EGL14.java
blob: cf09c5865b9816a2150b8323931b5148b385b783 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
/*
** Copyright 2012, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/

// This source file is automatically generated

package android.opengl;

import android.graphics.SurfaceTexture;
import android.view.Surface;
import android.view.SurfaceView;
import android.view.SurfaceHolder;

/**
 * EGL 1.4
 *
 */
public class EGL14 {

public static final int EGL_DEFAULT_DISPLAY            = 0;
public static EGLContext EGL_NO_CONTEXT                = null;
public static EGLDisplay EGL_NO_DISPLAY                = null;
public static EGLSurface EGL_NO_SURFACE                = null;

public static final int EGL_FALSE                          = 0;
public static final int EGL_TRUE                           = 1;
public static final int EGL_SUCCESS                        = 0x3000;
public static final int EGL_NOT_INITIALIZED                = 0x3001;
public static final int EGL_BAD_ACCESS                     = 0x3002;
public static final int EGL_BAD_ALLOC                      = 0x3003;
public static final int EGL_BAD_ATTRIBUTE                  = 0x3004;
public static final int EGL_BAD_CONFIG                     = 0x3005;
public static final int EGL_BAD_CONTEXT                    = 0x3006;
public static final int EGL_BAD_CURRENT_SURFACE            = 0x3007;
public static final int EGL_BAD_DISPLAY                    = 0x3008;
public static final int EGL_BAD_MATCH                      = 0x3009;
public static final int EGL_BAD_NATIVE_PIXMAP              = 0x300A;
public static final int EGL_BAD_NATIVE_WINDOW              = 0x300B;
public static final int EGL_BAD_PARAMETER                  = 0x300C;
public static final int EGL_BAD_SURFACE                    = 0x300D;
public static final int EGL_CONTEXT_LOST                   = 0x300E;
public static final int EGL_BUFFER_SIZE                    = 0x3020;
public static final int EGL_ALPHA_SIZE                     = 0x3021;
public static final int EGL_BLUE_SIZE                      = 0x3022;
public static final int EGL_GREEN_SIZE                     = 0x3023;
public static final int EGL_RED_SIZE                       = 0x3024;
public static final int EGL_DEPTH_SIZE                     = 0x3025;
public static final int EGL_STENCIL_SIZE                   = 0x3026;
public static final int EGL_CONFIG_CAVEAT                  = 0x3027;
public static final int EGL_CONFIG_ID                      = 0x3028;
public static final int EGL_LEVEL                          = 0x3029;
public static final int EGL_MAX_PBUFFER_HEIGHT             = 0x302A;
public static final int EGL_MAX_PBUFFER_PIXELS             = 0x302B;
public static final int EGL_MAX_PBUFFER_WIDTH              = 0x302C;
public static final int EGL_NATIVE_RENDERABLE              = 0x302D;
public static final int EGL_NATIVE_VISUAL_ID               = 0x302E;
public static final int EGL_NATIVE_VISUAL_TYPE             = 0x302F;
public static final int EGL_SAMPLES                        = 0x3031;
public static final int EGL_SAMPLE_BUFFERS                 = 0x3032;
public static final int EGL_SURFACE_TYPE                   = 0x3033;
public static final int EGL_TRANSPARENT_TYPE               = 0x3034;
public static final int EGL_TRANSPARENT_BLUE_VALUE         = 0x3035;
public static final int EGL_TRANSPARENT_GREEN_VALUE        = 0x3036;
public static final int EGL_TRANSPARENT_RED_VALUE          = 0x3037;
public static final int EGL_NONE                           = 0x3038;
public static final int EGL_BIND_TO_TEXTURE_RGB            = 0x3039;
public static final int EGL_BIND_TO_TEXTURE_RGBA           = 0x303A;
public static final int EGL_MIN_SWAP_INTERVAL              = 0x303B;
public static final int EGL_MAX_SWAP_INTERVAL              = 0x303C;
public static final int EGL_LUMINANCE_SIZE                 = 0x303D;
public static final int EGL_ALPHA_MASK_SIZE                = 0x303E;
public static final int EGL_COLOR_BUFFER_TYPE              = 0x303F;
public static final int EGL_RENDERABLE_TYPE                = 0x3040;
public static final int EGL_MATCH_NATIVE_PIXMAP            = 0x3041;
public static final int EGL_CONFORMANT                     = 0x3042;
public static final int EGL_SLOW_CONFIG                    = 0x3050;
public static final int EGL_NON_CONFORMANT_CONFIG          = 0x3051;
public static final int EGL_TRANSPARENT_RGB                = 0x3052;
public static final int EGL_RGB_BUFFER                     = 0x308E;
public static final int EGL_LUMINANCE_BUFFER               = 0x308F;
public static final int EGL_NO_TEXTURE                     = 0x305C;
public static final int EGL_TEXTURE_RGB                    = 0x305D;
public static final int EGL_TEXTURE_RGBA                   = 0x305E;
public static final int EGL_TEXTURE_2D                     = 0x305F;
public static final int EGL_PBUFFER_BIT                    = 0x0001;
public static final int EGL_PIXMAP_BIT                     = 0x0002;
public static final int EGL_WINDOW_BIT                     = 0x0004;
public static final int EGL_VG_COLORSPACE_LINEAR_BIT       = 0x0020;
public static final int EGL_VG_ALPHA_FORMAT_PRE_BIT        = 0x0040;
public static final int EGL_MULTISAMPLE_RESOLVE_BOX_BIT    = 0x0200;
public static final int EGL_SWAP_BEHAVIOR_PRESERVED_BIT    = 0x0400;
public static final int EGL_OPENGL_ES_BIT                  = 0x0001;
public static final int EGL_OPENVG_BIT                     = 0x0002;
public static final int EGL_OPENGL_ES2_BIT                 = 0x0004;
public static final int EGL_OPENGL_BIT                     = 0x0008;
public static final int EGL_VENDOR                         = 0x3053;
public static final int EGL_VERSION                        = 0x3054;
public static final int EGL_EXTENSIONS                     = 0x3055;
public static final int EGL_CLIENT_APIS                    = 0x308D;
public static final int EGL_HEIGHT                         = 0x3056;
public static final int EGL_WIDTH                          = 0x3057;
public static final int EGL_LARGEST_PBUFFER                = 0x3058;
public static final int EGL_TEXTURE_FORMAT                 = 0x3080;
public static final int EGL_TEXTURE_TARGET                 = 0x3081;
public static final int EGL_MIPMAP_TEXTURE                 = 0x3082;
public static final int EGL_MIPMAP_LEVEL                   = 0x3083;
public static final int EGL_RENDER_BUFFER                  = 0x3086;
public static final int EGL_VG_COLORSPACE                  = 0x3087;
public static final int EGL_VG_ALPHA_FORMAT                = 0x3088;
public static final int EGL_HORIZONTAL_RESOLUTION          = 0x3090;
public static final int EGL_VERTICAL_RESOLUTION            = 0x3091;
public static final int EGL_PIXEL_ASPECT_RATIO             = 0x3092;
public static final int EGL_SWAP_BEHAVIOR                  = 0x3093;
public static final int EGL_MULTISAMPLE_RESOLVE            = 0x3099;
public static final int EGL_BACK_BUFFER                    = 0x3084;
public static final int EGL_SINGLE_BUFFER                  = 0x3085;
public static final int EGL_VG_COLORSPACE_sRGB             = 0x3089;
public static final int EGL_VG_COLORSPACE_LINEAR           = 0x308A;
public static final int EGL_VG_ALPHA_FORMAT_NONPRE         = 0x308B;
public static final int EGL_VG_ALPHA_FORMAT_PRE            = 0x308C;
public static final int EGL_DISPLAY_SCALING                = 10000;
public static final int EGL_BUFFER_PRESERVED               = 0x3094;
public static final int EGL_BUFFER_DESTROYED               = 0x3095;
public static final int EGL_OPENVG_IMAGE                   = 0x3096;
public static final int EGL_CONTEXT_CLIENT_TYPE            = 0x3097;
public static final int EGL_CONTEXT_CLIENT_VERSION         = 0x3098;
public static final int EGL_MULTISAMPLE_RESOLVE_DEFAULT    = 0x309A;
public static final int EGL_MULTISAMPLE_RESOLVE_BOX        = 0x309B;
public static final int EGL_OPENGL_ES_API                  = 0x30A0;
public static final int EGL_OPENVG_API                     = 0x30A1;
public static final int EGL_OPENGL_API                     = 0x30A2;
public static final int EGL_DRAW                           = 0x3059;
public static final int EGL_READ                           = 0x305A;
public static final int EGL_CORE_NATIVE_ENGINE             = 0x305B;

    native private static void _nativeClassInit();
    static {
        _nativeClassInit();
    }
    // C function EGLint eglGetError ( void )

    public static native int eglGetError(
    );

    // C function EGLDisplay eglGetDisplay ( EGLNativeDisplayType display_id )

    public static native EGLDisplay eglGetDisplay(
        int display_id
    );

    /**
     * {@hide}
     */
    public static native EGLDisplay eglGetDisplay(
        long display_id
    );

    // C function EGLBoolean eglInitialize ( EGLDisplay dpy, EGLint *major, EGLint *minor )

    public static native boolean eglInitialize(
        EGLDisplay dpy,
        int[] major,
        int majorOffset,
        int[] minor,
        int minorOffset
    );

    // C function EGLBoolean eglTerminate ( EGLDisplay dpy )

    public static native boolean eglTerminate(
        EGLDisplay dpy
    );

    // C function const char * eglQueryString ( EGLDisplay dpy, EGLint name )

    public static native String eglQueryString(
        EGLDisplay dpy,
        int name
    );
    // C function EGLBoolean eglGetConfigs ( EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config )

    public static native boolean eglGetConfigs(
        EGLDisplay dpy,
        EGLConfig[] configs,
        int configsOffset,
        int config_size,
        int[] num_config,
        int num_configOffset
    );

    // C function EGLBoolean eglChooseConfig ( EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config )

    public static native boolean eglChooseConfig(
        EGLDisplay dpy,
        int[] attrib_list,
        int attrib_listOffset,
        EGLConfig[] configs,
        int configsOffset,
        int config_size,
        int[] num_config,
        int num_configOffset
    );

    // C function EGLBoolean eglGetConfigAttrib ( EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value )

    public static native boolean eglGetConfigAttrib(
        EGLDisplay dpy,
        EGLConfig config,
        int attribute,
        int[] value,
        int offset
    );

    // C function EGLSurface eglCreateWindowSurface ( EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list )

    private static native EGLSurface _eglCreateWindowSurface(
        EGLDisplay dpy,
        EGLConfig config,
        Object win,
        int[] attrib_list,
        int offset
    );

    private static native EGLSurface _eglCreateWindowSurfaceTexture(
        EGLDisplay dpy,
        EGLConfig config,
        Object win,
        int[] attrib_list,
        int offset
    );

    public static EGLSurface eglCreateWindowSurface(EGLDisplay dpy,
        EGLConfig config,
        Object win,
        int[] attrib_list,
        int offset
    ){
        Surface sur = null;
        if (win instanceof SurfaceView) {
            SurfaceView surfaceView = (SurfaceView)win;
            sur = surfaceView.getHolder().getSurface();
        } else if (win instanceof SurfaceHolder) {
            SurfaceHolder holder = (SurfaceHolder)win;
            sur = holder.getSurface();
        } else if (win instanceof Surface) {
            sur = (Surface) win;
        }

        EGLSurface surface;
        if (sur != null) {
            surface = _eglCreateWindowSurface(dpy, config, sur, attrib_list, offset);
        } else if (win instanceof SurfaceTexture) {
            surface = _eglCreateWindowSurfaceTexture(dpy, config,
                    win, attrib_list, offset);
        } else {
            throw new java.lang.UnsupportedOperationException(
                "eglCreateWindowSurface() can only be called with an instance of " +
                "Surface, SurfaceView, SurfaceTexture or SurfaceHolder at the moment, " +
                "this will be fixed later.");
        }

        return surface;
    }
    // C function EGLSurface eglCreatePbufferSurface ( EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list )

    public static native EGLSurface eglCreatePbufferSurface(
        EGLDisplay dpy,
        EGLConfig config,
        int[] attrib_list,
        int offset
    );

    // C function EGLSurface eglCreatePixmapSurface ( EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list )

    public static native EGLSurface eglCreatePixmapSurface(
        EGLDisplay dpy,
        EGLConfig config,
        int pixmap,
        int[] attrib_list,
        int offset
    );

    // C function EGLBoolean eglDestroySurface ( EGLDisplay dpy, EGLSurface surface )

    public static native boolean eglDestroySurface(
        EGLDisplay dpy,
        EGLSurface surface
    );

    // C function EGLBoolean eglQuerySurface ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value )

    public static native boolean eglQuerySurface(
        EGLDisplay dpy,
        EGLSurface surface,
        int attribute,
        int[] value,
        int offset
    );

    // C function EGLBoolean eglBindAPI ( EGLenum api )

    public static native boolean eglBindAPI(
        int api
    );

    // C function EGLenum eglQueryAPI ( void )

    public static native int eglQueryAPI(
    );

    // C function EGLBoolean eglWaitClient ( void )

    public static native boolean eglWaitClient(
    );

    // C function EGLBoolean eglReleaseThread ( void )

    public static native boolean eglReleaseThread(
    );

    // C function EGLSurface eglCreatePbufferFromClientBuffer ( EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list )
    // TODO Deprecate the below method
    public static native EGLSurface eglCreatePbufferFromClientBuffer(
        EGLDisplay dpy,
        int buftype,
        int buffer,
        EGLConfig config,
        int[] attrib_list,
        int offset
    );
    // TODO Unhide the below method
    /**
     * {@hide}
     */
    public static native EGLSurface eglCreatePbufferFromClientBuffer(
        EGLDisplay dpy,
        int buftype,
        long buffer,
        EGLConfig config,
        int[] attrib_list,
        int offset
    );

    // C function EGLBoolean eglSurfaceAttrib ( EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value )

    public static native boolean eglSurfaceAttrib(
        EGLDisplay dpy,
        EGLSurface surface,
        int attribute,
        int value
    );

    // C function EGLBoolean eglBindTexImage ( EGLDisplay dpy, EGLSurface surface, EGLint buffer )

    public static native boolean eglBindTexImage(
        EGLDisplay dpy,
        EGLSurface surface,
        int buffer
    );

    // C function EGLBoolean eglReleaseTexImage ( EGLDisplay dpy, EGLSurface surface, EGLint buffer )

    public static native boolean eglReleaseTexImage(
        EGLDisplay dpy,
        EGLSurface surface,
        int buffer
    );

    // C function EGLBoolean eglSwapInterval ( EGLDisplay dpy, EGLint interval )

    public static native boolean eglSwapInterval(
        EGLDisplay dpy,
        int interval
    );

    // C function EGLContext eglCreateContext ( EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list )

    public static native EGLContext eglCreateContext(
        EGLDisplay dpy,
        EGLConfig config,
        EGLContext share_context,
        int[] attrib_list,
        int offset
    );

    // C function EGLBoolean eglDestroyContext ( EGLDisplay dpy, EGLContext ctx )

    public static native boolean eglDestroyContext(
        EGLDisplay dpy,
        EGLContext ctx
    );

    // C function EGLBoolean eglMakeCurrent ( EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx )

    public static native boolean eglMakeCurrent(
        EGLDisplay dpy,
        EGLSurface draw,
        EGLSurface read,
        EGLContext ctx
    );

    // C function EGLContext eglGetCurrentContext ( void )

    public static native EGLContext eglGetCurrentContext(
    );

    // C function EGLSurface eglGetCurrentSurface ( EGLint readdraw )

    public static native EGLSurface eglGetCurrentSurface(
        int readdraw
    );

    // C function EGLDisplay eglGetCurrentDisplay ( void )

    public static native EGLDisplay eglGetCurrentDisplay(
    );

    // C function EGLBoolean eglQueryContext ( EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value )

    public static native boolean eglQueryContext(
        EGLDisplay dpy,
        EGLContext ctx,
        int attribute,
        int[] value,
        int offset
    );

    // C function EGLBoolean eglWaitGL ( void )

    public static native boolean eglWaitGL(
    );

    // C function EGLBoolean eglWaitNative ( EGLint engine )

    public static native boolean eglWaitNative(
        int engine
    );

    // C function EGLBoolean eglSwapBuffers ( EGLDisplay dpy, EGLSurface surface )

    public static native boolean eglSwapBuffers(
        EGLDisplay dpy,
        EGLSurface surface
    );

    // C function EGLBoolean eglCopyBuffers ( EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target )

    public static native boolean eglCopyBuffers(
        EGLDisplay dpy,
        EGLSurface surface,
        int target
    );

}