JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
GLBuffers.java
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * - Redistribution of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * - Redistribution in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * Neither the name of Sun Microsystems, Inc. or the names of
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18 *
19 * This software is provided "AS IS," without a warranty of any kind. ALL
20 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
21 * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
22 * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
23 * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
24 * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
25 * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
26 * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
27 * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
28 * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
29 * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
30 * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
31 *
32 * You acknowledge that this software is not designed or intended for use
33 * in the design, construction, operation or maintenance of any nuclear
34 * facility.
35 *
36 * Sun gratefully acknowledges that this software was originally authored
37 * and developed by Kenneth Bradley Russell and Christopher John Kline.
38 */
39package com.jogamp.opengl.util;
40
41import java.nio.Buffer;
42import java.nio.ByteBuffer;
43
44import com.jogamp.opengl.GL;
45import com.jogamp.opengl.GL2;
46import com.jogamp.opengl.GL2ES2;
47import com.jogamp.opengl.GL2ES3;
48import com.jogamp.opengl.GL2GL3;
49import com.jogamp.opengl.GLContext;
50import com.jogamp.opengl.GLES2;
51import com.jogamp.opengl.GLException;
52
53import com.jogamp.common.nio.Buffers;
54
55/**
56 * Utility routines for dealing with direct buffers.
57 *
58 * @author Kenneth Russel, et.al.
59 */
60public class GLBuffers extends Buffers {
61
62 /**
63 * @param glType GL primitive type
64 * @return false if one of GL primitive unsigned types, otherwise true
65 * GL_UNSIGNED_BYTE, <br/>
66 * GL_UNSIGNED_SHORT, <br/>
67 * GL_UNSIGNED_INT, <br/>
68 * GL_HILO16_NV <br/>
69 */
70 public static final boolean isSignedGLType(final int glType) {
71 switch (glType) { // 29
75 case GL2.GL_HILO16_NV:
76 return false;
77
78 }
79 return true;
80 }
81
82 /**
83 * @param glType GL primitive type
84 * @return false if one of GL primitive floating point types, otherwise true
85 * GL_FLOAT, <br/>
86 * GL_HALF_FLOAT, <br/>
87 * GL_HALF_FLOAT_OES, <br/>
88 * GL_DOUBLE <br/>
89 */
90 public static final boolean isGLTypeFixedPoint(final int glType) {
91 switch(glType) {
92 case GL.GL_FLOAT:
93 case GL.GL_HALF_FLOAT:
95 case GL2GL3.GL_DOUBLE:
96 return false;
97
98 default:
99 return true;
100 }
101 }
102
103 /**
104 * @param glType shall be one of (31) <br/>
105 * GL_BYTE, GL_UNSIGNED_BYTE, <br/>
106 * GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, <br/>
107 * <br/>
108 * GL_SHORT, GL_UNSIGNED_SHORT, <br/>
109 * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/>
110 * GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, <br/>
111 * GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, <br/>
112 * GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, <br/>
113 * GL.GL_HALF_FLOAT, GLES2.GL_HALF_FLOAT_OES: <br/>
114 * <br/>
115 * GL_FIXED, GL_INT <br/>
116 * GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8, <br/>
117 * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/>
118 * GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8, <br/>
119 * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/>
120 * GL_HILO16_NV, GL_SIGNED_HILO16_NV <br/>
121 * <br/>
122 * GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV <br/>
123 * <br/>
124 * GL_FLOAT, GL_DOUBLE <br/>
125 *
126 * @return -1 if glType is unhandled, otherwise the actual value > 0
127 */
128 public static final int sizeOfGLType(final int glType) {
129 switch (glType) { // 29
130 // case GL2.GL_BITMAP:
131 case GL.GL_BYTE:
132 case GL.GL_UNSIGNED_BYTE:
135 return SIZEOF_BYTE;
136
137 case GL.GL_SHORT:
147 case GL.GL_HALF_FLOAT:
149 return SIZEOF_SHORT;
150
151 case GL.GL_FIXED:
152 case GL2ES2.GL_INT:
153 case GL.GL_UNSIGNED_INT:
161 case GL2.GL_HILO16_NV:
163 return SIZEOF_INT;
164
166 return SIZEOF_LONG;
167
168 case GL.GL_FLOAT:
169 return SIZEOF_FLOAT;
170
171 case GL2GL3.GL_DOUBLE:
172 return SIZEOF_DOUBLE;
173 }
174 return -1;
175 }
176
177 /**
178 * @param glType shall be one of (31) <br/>
179 * GL_BYTE, GL_UNSIGNED_BYTE, <br/>
180 * GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, <br/>
181 * <br/>
182 * GL_SHORT, GL_UNSIGNED_SHORT, <br/>
183 * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/>
184 * GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, <br/>
185 * GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, <br/>
186 * GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, <br/>
187 * GL_HALF_FLOAT, GL_HALF_FLOAT_OES <br/>
188 * <br/>
189 * GL_FIXED, GL_INT <br/>
190 * GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8, <br/>
191 * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/>
192 * GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8, <br/>
193 * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/>
194 * GL_HILO16_NV, GL_SIGNED_HILO16_NV <br/>
195 * <br/>
196 * GL_FLOAT_32_UNSIGNED_INT_24_8_REV <br/>
197 * <br/>
198 * GL_FLOAT, GL_DOUBLE <br/>
199 *
200 * @return null if glType is unhandled, otherwise the new Buffer object
201 */
202 public static final Buffer newDirectGLBuffer(final int glType, final int numElements) {
203 switch (glType) { // 29
204 case GL.GL_BYTE:
205 case GL.GL_UNSIGNED_BYTE:
208 return newDirectByteBuffer(numElements);
209
210 case GL.GL_SHORT:
220 case GL.GL_HALF_FLOAT:
222 return newDirectShortBuffer(numElements);
223
224 case GL.GL_FIXED:
225 case GL2ES2.GL_INT:
226 case GL.GL_UNSIGNED_INT:
234 case GL2.GL_HILO16_NV:
236 return newDirectIntBuffer(numElements);
237
239 return newDirectLongBuffer(numElements);
240
241 case GL.GL_FLOAT:
242 return newDirectFloatBuffer(numElements);
243
244 case GL2GL3.GL_DOUBLE:
245 return newDirectDoubleBuffer(numElements);
246 }
247 return null;
248 }
249
250 /**
251 * @param glType shall be one of (31) <br/>
252 * GL_BYTE, GL_UNSIGNED_BYTE, <br/>
253 * GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, <br/>
254 * <br/>
255 * GL_SHORT, GL_UNSIGNED_SHORT, <br/>
256 * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/>
257 * GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, <br/>
258 * GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, <br/>
259 * GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, <br/>
260 * GL_HALF_FLOAT, GL_HALF_FLOAT_OES <br/>
261 * <br/>
262 * GL_FIXED, GL_INT <br/>
263 * GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8, <br/>
264 * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/>
265 * GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8, <br/>
266 * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/>
267 * GL_HILO16_NV, GL_SIGNED_HILO16_NV <br/>
268 * <br/>
269 * GL_FLOAT_32_UNSIGNED_INT_24_8_REV <br/>
270 * <br/>
271 * GL_FLOAT, GL_DOUBLE <br/>
272 * @return null if glType is unhandled or parent is null or bufLen is 0, otherwise the new Buffer object
273 */
274 public static final Buffer sliceGLBuffer(final ByteBuffer parent, final int bytePos, final int byteLen, final int glType) {
275 if (parent == null || byteLen == 0) {
276 return null;
277 }
278 final int parentPos = parent.position();
279 final int parentLimit = parent.limit();
280
281 parent.position(bytePos);
282 parent.limit(bytePos + byteLen);
283 Buffer res = null;
284
285 switch (glType) { // 29
286 case GL.GL_BYTE:
287 case GL.GL_UNSIGNED_BYTE:
290 res = parent.slice().order(parent.order()); // slice and duplicate may change byte order
291 break;
292
293 case GL.GL_SHORT:
303 case GL.GL_HALF_FLOAT:
305 res = parent.slice().order(parent.order()).asShortBuffer(); // slice and duplicate may change byte order
306 break;
307
308 case GL.GL_FIXED:
309 case GL2ES2.GL_INT:
310 case GL.GL_UNSIGNED_INT:
318 case GL2.GL_HILO16_NV:
320 res = parent.slice().order(parent.order()).asIntBuffer(); // slice and duplicate may change byte order
321 break;
322
324 res = parent.slice().order(parent.order()).asLongBuffer(); // slice and duplicate may change byte order
325 break;
326
327 case GL.GL_FLOAT:
328 res = parent.slice().order(parent.order()).asFloatBuffer(); // slice and duplicate may change byte order
329 break;
330
331 case GL2GL3.GL_DOUBLE:
332 res = parent.slice().order(parent.order()).asDoubleBuffer(); // slice and duplicate may change byte order
333 break;
334 }
335 parent.position(parentPos).limit(parentLimit);
336 return res;
337 }
338
339 private static final int glGetInteger(final GL gl, final int pname, final int[] tmp) {
340 gl.glGetIntegerv(pname, tmp, 0);
341 return tmp[0];
342 }
343
344 /**
345 * Returns the number of bytes required to read/write a memory buffer via OpenGL
346 * using the current GL pixel storage state and the given parameters.
347 *
348 * <p>This method is security critical, hence it throws an exception (fail-fast)
349 * in case of an invalid alignment. In case we forgot to handle
350 * proper values, please contact the maintainer.</p>
351 *
352 * @param gl the current GL object
353 *
354 * @param tmp a pass through integer array of size >= 1 used to store temp data (performance)
355 *
356 * @param bytesPerPixel bytes per pixel, i.e. via {@link #bytesPerPixel(int, int)}.
357 * @param width in pixels
358 * @param height in pixels
359 * @param depth in pixels
360 * @param pack true for read mode GPU -> CPU (pack), otherwise false for write mode CPU -> GPU (unpack)
361 * @return required minimum size of the buffer in bytes
362 * @throws GLException if alignment is invalid. Please contact the maintainer if this is our bug.
363 */
364 public static final int sizeof(final GL gl, final int tmp[],
365 final int bytesPerPixel, int width, int height, int depth,
366 final boolean pack) {
367 int rowLength = 0;
368 int skipRows = 0;
369 int skipPixels = 0;
370 int alignment = 1;
371 int imageHeight = 0;
372 int skipImages = 0;
373
374 if (pack) {
375 alignment = glGetInteger(gl, GL.GL_PACK_ALIGNMENT, tmp); // es2, es3, gl3
376 if( gl.isGL2ES3() ) {
377 rowLength = glGetInteger(gl, GL2ES3.GL_PACK_ROW_LENGTH, tmp); // es3, gl3
378 skipRows = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_ROWS, tmp); // es3, gl3
379 skipPixels = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_PIXELS, tmp); // es3, gl3
380 if (depth > 1 && gl.isGL2GL3() && gl.getContext().getGLVersionNumber().compareTo(GLContext.Version1_2) >= 0 ) {
381 imageHeight = glGetInteger(gl, GL2GL3.GL_PACK_IMAGE_HEIGHT, tmp); // gl3, GL_VERSION_1_2
382 skipImages = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_IMAGES, tmp); // gl3, GL_VERSION_1_2
383 }
384 }
385 } else {
386 alignment = glGetInteger(gl, GL.GL_UNPACK_ALIGNMENT, tmp); // es2, es3, gl3
387 if( gl.isGL2ES3() ) {
388 rowLength = glGetInteger(gl, GL2ES2.GL_UNPACK_ROW_LENGTH, tmp); // es3, gl3
389 skipRows = glGetInteger(gl, GL2ES2.GL_UNPACK_SKIP_ROWS, tmp); // es3, gl3
390 skipPixels = glGetInteger(gl, GL2ES2.GL_UNPACK_SKIP_PIXELS, tmp); // es3, gl3
391 if( depth > 1 &&
392 ( gl.isGL3ES3() ||
393 ( gl.isGL2GL3() && gl.getContext().getGLVersionNumber().compareTo(GLContext.Version1_2) >= 0 )
394 )
395 ) {
396 imageHeight = glGetInteger(gl, GL2ES3.GL_UNPACK_IMAGE_HEIGHT, tmp);// es3, gl3, GL_VERSION_1_2
397 skipImages = glGetInteger(gl, GL2ES3.GL_UNPACK_SKIP_IMAGES, tmp); // es3, gl3, GL_VERSION_1_2
398 }
399 }
400 }
401
402 // Try to deal somewhat correctly with potentially invalid values
403 width = Math.max(0, width );
404 height = Math.max(1, height); // min 1D
405 depth = Math.max(1, depth ); // min 1 * imageSize
406 skipRows = Math.max(0, skipRows);
407 skipPixels = Math.max(0, skipPixels);
408 alignment = Math.max(1, alignment);
409 skipImages = Math.max(0, skipImages);
410
411 imageHeight = ( imageHeight > 0 ) ? imageHeight : height;
412 rowLength = ( rowLength > 0 ) ? rowLength : width;
413
414 int rowLengthInBytes = rowLength * bytesPerPixel;
415 int skipBytes = skipPixels * bytesPerPixel;
416
417 switch(alignment) {
418 case 1:
419 break;
420 case 2:
421 case 4:
422 case 8: {
423 // x % 2n == x & (2n - 1)
424 int remainder = rowLengthInBytes & ( alignment - 1 );
425 if (remainder > 0) {
426 rowLengthInBytes += alignment - remainder;
427 }
428 remainder = skipBytes & ( alignment - 1 );
429 if (remainder > 0) {
430 skipBytes += alignment - remainder;
431 }
432 }
433 break;
434 default:
435 throw new GLException("Invalid alignment "+alignment+", must be 2**n (1,2,4,8). Pls notify the maintainer in case this is our bug.");
436 }
437
438 /**
439 * skipImages, depth, skipPixels and skipRows are static offsets.
440 *
441 * skipImages and depth are in multiples of image size.
442 *
443 * skipBytes and rowLengthInBytes are aligned
444 *
445 * rowLengthInBytes is the aligned byte offset
446 * from line n to line n+1 at the same x-axis position.
447 */
448 return
449 skipBytes + // aligned skipPixels * bpp
450 ( skipImages + depth - 1 ) * imageHeight * rowLengthInBytes + // aligned whole images
451 ( skipRows + height - 1 ) * rowLengthInBytes + // aligned lines
452 width * bytesPerPixel; // last line
453 }
454
455 /**
456 * Returns the number of bytes required to read/write a memory buffer via OpenGL
457 * using the current GL pixel storage state and the given parameters.
458 *
459 * <p>This method is security critical, hence it throws an exception (fail-fast)
460 * in case either the format, type or alignment is unhandled. In case we forgot to handle
461 * proper values, please contact the maintainer.</p>
462 *
463 * <p> See {@link #bytesPerPixel(int, int)}. </p>
464 *
465 * @param gl the current GL object
466 *
467 * @param tmp a pass through integer array of size >= 1 used to store temp data (performance)
468 *
469 * @param format must be one of (27) <br/>
470 * GL_COLOR_INDEX GL_STENCIL_INDEX <br/>
471 * GL_DEPTH_COMPONENT GL_DEPTH_STENCIL <br/>
472 * GL_RED GL_RED_INTEGER <br/>
473 * GL_GREEN GL_GREEN_INTEGER <br/>
474 * GL_BLUE GL_BLUE_INTEGER <br/>
475 * GL_ALPHA GL_LUMINANCE (12) <br/>
476 * <br/>
477 * GL_LUMINANCE_ALPHA GL_RG <br/>
478 * GL_RG_INTEGER GL_HILO_NV <br/>
479 * GL_SIGNED_HILO_NV (5) <br/>
480 * <br/>
481 * GL_YCBCR_422_APPLE <br/>
482 * <br/>
483 * GL_RGB GL_RGB_INTEGER <br/>
484 * GL_BGR GL_BGR_INTEGER (4)<br/>
485 * <br/>
486 * GL_RGBA GL_RGBA_INTEGER <br/>
487 * GL_BGRA GL_BGRA_INTEGER <br/>
488 * GL_ABGR_EXT (5)<br/>
489 *
490 * @param type must be one of (32) <br/>
491 * GL_BITMAP, <br/>
492 * GL_BYTE, GL_UNSIGNED_BYTE, <br/>
493 * GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, <br/>
494 * <br/>
495 * GL_SHORT, GL_UNSIGNED_SHORT, <br/>
496 * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/>
497 * GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, <br/>
498 * GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, <br/>
499 * GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, <br/>
500 * GL_HALF_FLOAT, GL_HALF_FLOAT_OES <br/>
501 * <br/>
502 * GL_FIXED, GL_INT <br/>
503 * GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8, <br/>
504 * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/>
505 * GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8, <br/>
506 * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/>
507 * GL_HILO16_NV, GL_SIGNED_HILO16_NV <br/>
508 * <br/>
509 * GL_FLOAT_32_UNSIGNED_INT_24_8_REV <br/>
510 * <br/>
511 * GL_FLOAT, GL_DOUBLE <br/>
512 *
513 * @param width in pixels
514 * @param height in pixels
515 * @param depth in pixels
516 * @param pack true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPU
517 * @return required minimum size of the buffer in bytes
518 * @throws GLException if format, type or alignment is not handled. Please contact the maintainer if this is our bug.
519 */
520 public static final int sizeof(final GL gl, final int tmp[],
521 final int format, final int type, final int width, final int height, final int depth,
522 final boolean pack) throws GLException {
523 if (width < 0) return 0;
524 if (height < 0) return 0;
525 if (depth < 0) return 0;
526
527 final int bytesPerPixel = bytesPerPixel(format, type);
528 return sizeof(gl, tmp, bytesPerPixel, width, height, depth, pack);
529 }
530
531 /**
532 * Returns the number of bytes required for one pixel with the the given OpenGL format and type.
533 *
534 * <p>This method is security critical, hence it throws an exception (fail-fast)
535 * in case either the format, type or alignment is unhandled. In case we forgot to handle
536 * proper values, please contact the maintainer.</p>
537 *
538 * <p> See {@link #componentCount(int)}. </p>
539 *
540 * @param format must be one of (27) <br/>
541 * GL_COLOR_INDEX GL_STENCIL_INDEX <br/>
542 * GL_DEPTH_COMPONENT GL_DEPTH_STENCIL <br/>
543 * GL_RED GL_RED_INTEGER <br/>
544 * GL_GREEN GL_GREEN_INTEGER <br/>
545 * GL_BLUE GL_BLUE_INTEGER <br/>
546 * GL_ALPHA GL_LUMINANCE (12) <br/>
547 * <br/>
548 * GL_LUMINANCE_ALPHA GL_RG <br/>
549 * GL_RG_INTEGER GL_HILO_NV <br/>
550 * GL_SIGNED_HILO_NV (5) <br/>
551 * <br/>
552 * GL_YCBCR_422_APPLE <br/>
553 * <br/>
554 * GL_RGB GL_RGB_INTEGER <br/>
555 * GL_BGR GL_BGR_INTEGER (4)<br/>
556 * <br/>
557 * GL_RGBA GL_RGBA_INTEGER <br/>
558 * GL_BGRA GL_BGRA_INTEGER <br/>
559 * GL_ABGR_EXT (5)<br/>
560 *
561 * @param type must be one of (32) <br/>
562 * GL_BITMAP, <br/>
563 * GL_BYTE, GL_UNSIGNED_BYTE, <br/>
564 * GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, <br/>
565 * <br/>
566 * GL_SHORT, GL_UNSIGNED_SHORT, <br/>
567 * GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, <br/>
568 * GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, <br/>
569 * GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, <br/>
570 * GL_UNSIGNED_SHORT_8_8_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, <br/>
571 * GL_HALF_FLOAT, GL_HALF_FLOAT_OES <br/>
572 * <br/>
573 * GL_FIXED, GL_INT <br/>
574 * GL_UNSIGNED_INT, GL_UNSIGNED_INT_8_8_8_8, <br/>
575 * GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, <br/>
576 * GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_INT_24_8, <br/>
577 * GL_UNSIGNED_INT_10F_11F_11F_REV, GL_UNSIGNED_INT_5_9_9_9_REV <br/>
578 * GL_HILO16_NV, GL_SIGNED_HILO16_NV <br/>
579 * <br/>
580 * GL_FLOAT_32_UNSIGNED_INT_24_8_REV <br/>
581 * <br/>
582 * GL_FLOAT, GL_DOUBLE <br/>
583 *
584 * @return required size of one pixel in bytes
585 * @throws GLException if format or type alignment is not handled. Please contact the maintainer if this is our bug.
586 */
587 public static final int bytesPerPixel(final int format, final int type) throws GLException {
588 int compSize = 0;
589
590 int compCount = componentCount(format);
591
592 switch (type) /* 30 */ {
593 case GL2.GL_BITMAP:
594 if (GL2.GL_COLOR_INDEX == format || GL2ES2.GL_STENCIL_INDEX == format) {
595 compSize = 1;
596 } else {
597 throw new GLException("BITMAP type only supported for format COLOR_INDEX and STENCIL_INDEX, not 0x"+Integer.toHexString(format));
598 }
599 break;
600 case GL.GL_BYTE:
601 case GL.GL_UNSIGNED_BYTE:
602 compSize = 1;
603 break;
604 case GL.GL_SHORT:
606 case GL.GL_HALF_FLOAT:
608 compSize = 2;
609 break;
610 case GL.GL_FIXED:
611 case GL2ES2.GL_INT:
612 case GL.GL_UNSIGNED_INT:
613 case GL.GL_FLOAT:
614 compSize = 4;
615 break;
616 case GL2GL3.GL_DOUBLE:
617 compSize = 8;
618 break;
619
622 compSize = 1;
623 compCount = 1;
624 break;
633 compSize = 2;
634 compCount = 1;
635 break;
636 case GL2.GL_HILO16_NV:
638 compSize = 2;
639 compCount = 2;
640 break;
648 compSize = 4;
649 compCount = 1;
650 break;
652 compSize = 8;
653 compCount = 1;
654 break;
655
656 default:
657 throw new GLException("type 0x"+Integer.toHexString(type)+"/"+"format 0x"+Integer.toHexString(format)+" not supported [yet], pls notify the maintainer in case this is our bug.");
658 }
659 return compCount * compSize;
660 }
661
662 /**
663 * Returns the number of components required for the given OpenGL format.
664 *
665 * <p>This method is security critical, hence it throws an exception (fail-fast)
666 * in case either the format, type or alignment is unhandled. In case we forgot to handle
667 * proper values, please contact the maintainer.</p>
668 *
669 * @param format must be one of (27) <br/>
670 * GL_COLOR_INDEX GL_STENCIL_INDEX <br/>
671 * GL_DEPTH_COMPONENT GL_DEPTH_STENCIL <br/>
672 * GL_RED GL_RED_INTEGER <br/>
673 * GL_GREEN GL_GREEN_INTEGER <br/>
674 * GL_BLUE GL_BLUE_INTEGER <br/>
675 * GL_ALPHA GL_LUMINANCE (12) <br/>
676 * <br/>
677 * GL_LUMINANCE_ALPHA GL_RG <br/>
678 * GL_RG_INTEGER GL_HILO_NV <br/>
679 * GL_SIGNED_HILO_NV (5) <br/>
680 * <br/>
681 * GL_YCBCR_422_APPLE <br/>
682 * <br/>
683 * GL_RGB GL_RGB_INTEGER <br/>
684 * GL_BGR GL_BGR_INTEGER (4)<br/>
685 * <br/>
686 * GL_RGBA GL_RGBA_INTEGER <br/>
687 * GL_BGRA GL_BGRA_INTEGER <br/>
688 * GL_ABGR_EXT (5)<br/>
689 *
690 * @return number of components required for the given OpenGL format
691 * @throws GLException if format is not handled. Please contact the maintainer if this is our bug.
692 */
693 public static final int componentCount(final int format) throws GLException {
694 final int compCount;
695
696 switch (format) /* 26 */ {
697 case GL2.GL_COLOR_INDEX:
700 case GL.GL_DEPTH_STENCIL:
701 case GL2ES2.GL_RED:
703 case GL2ES3.GL_GREEN:
705 case GL2ES3.GL_BLUE:
707 case GL.GL_ALPHA:
708 case GL.GL_LUMINANCE:
709 compCount = 1;
710 break;
712 case GL2ES2.GL_RG:
714 case GL2.GL_HILO_NV:
716 compCount = 2;
717 break;
718 case GL.GL_RGB:
720 case GL.GL_BGR:
722 compCount = 3;
723 break;
725 compCount = 3;
726 break;
727 case GL.GL_RGBA:
729 case GL.GL_BGRA:
731 case GL2.GL_ABGR_EXT:
732 compCount = 4;
733 break;
734 /* FIXME ??
735 case GL.GL_HILO_NV:
736 elements = 2;
737 break; */
738 default:
739 throw new GLException("format 0x"+Integer.toHexString(format)+" not supported [yet], pls notify the maintainer in case this is our bug.");
740 }
741 return compCount;
742 }
743
744 public static final int getNextPowerOf2(int number) {
745 if (((number-1) & number) == 0) {
746 //ex: 8 -> 0b1000; 8-1=7 -> 0b0111; 0b1000&0b0111 == 0
747 return number;
748 }
749 int power = 0;
750 while (number > 0) {
751 number = number>>1;
752 power++;
753 }
754 return (1<<power);
755 }
756
757 //----------------------------------------------------------------------
758 // Conversion routines
759 //
760 public final static float[] getFloatArray(final double[] source) {
761 int i = source.length;
762 final float[] dest = new float[i--];
763 while (i >= 0) {
764 dest[i] = (float) source[i];
765 i--;
766 }
767 return dest;
768 }
769}
Abstraction for an OpenGL rendering context.
Definition: GLContext.java:74
static final VersionNumber Version1_2
Version 1.2, i.e.
Definition: GLContext.java:135
final VersionNumber getGLVersionNumber()
Returns this context OpenGL version.
Definition: GLContext.java:777
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Utility routines for dealing with direct buffers.
Definition: GLBuffers.java:60
static final int componentCount(final int format)
Returns the number of components required for the given OpenGL format.
Definition: GLBuffers.java:693
static final Buffer sliceGLBuffer(final ByteBuffer parent, final int bytePos, final int byteLen, final int glType)
Definition: GLBuffers.java:274
static final boolean isSignedGLType(final int glType)
Definition: GLBuffers.java:70
static final int sizeof(final GL gl, final int tmp[], final int bytesPerPixel, int width, int height, int depth, final boolean pack)
Returns the number of bytes required to read/write a memory buffer via OpenGL using the current GL pi...
Definition: GLBuffers.java:364
static final boolean isGLTypeFixedPoint(final int glType)
Definition: GLBuffers.java:90
static final int sizeof(final GL gl, final int tmp[], final int format, final int type, final int width, final int height, final int depth, final boolean pack)
Returns the number of bytes required to read/write a memory buffer via OpenGL using the current GL pi...
Definition: GLBuffers.java:520
static final int bytesPerPixel(final int format, final int type)
Returns the number of bytes required for one pixel with the the given OpenGL format and type.
Definition: GLBuffers.java:587
static final int sizeOfGLType(final int glType)
Definition: GLBuffers.java:128
static final int getNextPowerOf2(int number)
Definition: GLBuffers.java:744
static final float[] getFloatArray(final double[] source)
Definition: GLBuffers.java:760
static final Buffer newDirectGLBuffer(final int glType, final int numElements)
Definition: GLBuffers.java:202
static final int GL_UNPACK_ROW_LENGTH
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_EXT_unpack_subimage Alias for: GL_UNPACK_ROW_LE...
Definition: GL2ES2.java:336
static final int GL_UNPACK_SKIP_PIXELS
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_EXT_unpack_subimage Alias for: GL_UNPACK_SKIP_P...
Definition: GL2ES2.java:297
static final int GL_RED
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_NV_blend_equation_advanced, GL_EXT_texture_rg A...
Definition: GL2ES2.java:596
static final int GL_UNSIGNED_INT_2_10_10_10_REV
GL_ES_VERSION_3_0, GL_VERSION_1_2, GL_EXT_texture_type_2_10_10_10_REV Alias for: GL_UNSIGNED_INT_2_10...
Definition: GL2ES2.java:300
static final int GL_STENCIL_INDEX
Part of GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0
Definition: GL2ES2.java:1423
static final int GL_INT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_INT" with expression '0x1404',...
Definition: GL2ES2.java:200
static final int GL_RG
GL_ES_VERSION_3_0, GL_ARB_texture_rg, GL_VERSION_3_0, GL_EXT_texture_rg Alias for: GL_RG_EXT Define ...
Definition: GL2ES2.java:398
static final int GL_UNPACK_SKIP_ROWS
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_EXT_unpack_subimage Alias for: GL_UNPACK_SKIP_R...
Definition: GL2ES2.java:370
static final int GL_DEPTH_COMPONENT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_DEPTH_COMPONENT" with expression '0x1902...
Definition: GL2ES2.java:386
static final int GL_UNSIGNED_INT_10_10_10_2
GL_VERSION_1_2, GL_EXT_packed_pixels, GL_OES_vertex_type_10_10_10_2 Alias for: GL_UNSIGNED_INT_10_10_...
Definition: GL2ES2.java:415
static final int GL_GREEN
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_NV_blend_equation_advanced Alias for: GL_GREEN_...
Definition: GL2ES3.java:431
static final int GL_PACK_SKIP_PIXELS
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_PACK_SKIP_PIXELS" with expression '0x0D0...
Definition: GL2ES3.java:547
static final int GL_FLOAT_32_UNSIGNED_INT_24_8_REV
GL_ARB_depth_buffer_float, GL_ES_VERSION_3_0, GL_VERSION_3_0, GL_NV_depth_buffer_float Alias for: GL_...
Definition: GL2ES3.java:286
static final int GL_BLUE
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_NV_blend_equation_advanced Alias for: GL_BLUE_N...
Definition: GL2ES3.java:518
static final int GL_RGBA_INTEGER
GL_ES_VERSION_3_0, GL_VERSION_3_0, GL_EXT_texture_integer Alias for: GL_RGBA_INTEGER_EXT Define "GL_...
Definition: GL2ES3.java:128
static final int GL_UNPACK_SKIP_IMAGES
GL_ES_VERSION_3_0, GL_VERSION_1_2, GL_EXT_texture3D Alias for: GL_UNPACK_SKIP_IMAGES_EXT Define "GL_...
Definition: GL2ES3.java:242
static final int GL_RG_INTEGER
GL_ES_VERSION_3_0, GL_ARB_texture_rg, GL_VERSION_3_0 Define "GL_RG_INTEGER" with expression '0x8228',...
Definition: GL2ES3.java:534
static final int GL_RED_INTEGER
GL_ES_VERSION_3_0, GL_VERSION_3_0, GL_EXT_texture_integer Alias for: GL_RED_INTEGER_EXT Define "GL_R...
Definition: GL2ES3.java:159
static final int GL_UNSIGNED_INT_5_9_9_9_REV
GL_ES_VERSION_3_0, GL_VERSION_3_0, GL_EXT_texture_shared_exponent, GL_APPLE_texture_packed_float Alia...
Definition: GL2ES3.java:134
static final int GL_PACK_SKIP_ROWS
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_PACK_SKIP_ROWS" with expression '0x0D03'...
Definition: GL2ES3.java:714
static final int GL_UNPACK_IMAGE_HEIGHT
GL_ES_VERSION_3_0, GL_VERSION_1_2, GL_EXT_texture3D Alias for: GL_UNPACK_IMAGE_HEIGHT_EXT Define "GL...
Definition: GL2ES3.java:336
static final int GL_PACK_ROW_LENGTH
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_PACK_ROW_LENGTH" with expression '0x0D02...
Definition: GL2ES3.java:136
static final int GL_RGB_INTEGER
GL_ES_VERSION_3_0, GL_VERSION_3_0, GL_EXT_texture_integer Alias for: GL_RGB_INTEGER_EXT Define "GL_R...
Definition: GL2ES3.java:550
static final int GL_PACK_IMAGE_HEIGHT
GL_VERSION_1_2, GL_EXT_texture3D Alias for: GL_PACK_IMAGE_HEIGHT_EXT Define "GL_PACK_IMAGE_HEIGHT" w...
Definition: GL2GL3.java:42
static final int GL_UNSIGNED_SHORT_5_6_5_REV
GL_VERSION_1_2 Define "GL_UNSIGNED_SHORT_5_6_5_REV" with expression '0x8364', CType: int
Definition: GL2GL3.java:453
static final int GL_UNSIGNED_INT_8_8_8_8
GL_VERSION_1_2, GL_EXT_packed_pixels Alias for: GL_UNSIGNED_INT_8_8_8_8_EXT Define "GL_UNSIGNED_INT_...
Definition: GL2GL3.java:366
static final int GL_DOUBLE
GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_DOUBLE" with expression '0x140A', CType: int
Definition: GL2GL3.java:237
static final int GL_UNSIGNED_SHORT_4_4_4_4_REV
GL_VERSION_1_2, GL_EXT_read_format_bgra, GL_IMG_read_format Alias for: GL_UNSIGNED_SHORT_4_4_4_4_REV_...
Definition: GL2GL3.java:401
static final int GL_BGRA_INTEGER
GL_VERSION_3_0, GL_EXT_texture_integer Alias for: GL_BGRA_INTEGER_EXT Define "GL_BGRA_INTEGER" with ...
Definition: GL2GL3.java:215
static final int GL_UNSIGNED_INT_8_8_8_8_REV
GL_VERSION_1_2 Define "GL_UNSIGNED_INT_8_8_8_8_REV" with expression '0x8367', CType: int
Definition: GL2GL3.java:368
static final int GL_UNSIGNED_BYTE_3_3_2
GL_VERSION_1_2, GL_EXT_packed_pixels Alias for: GL_UNSIGNED_BYTE_3_3_2_EXT Define "GL_UNSIGNED_BYTE_...
Definition: GL2GL3.java:344
static final int GL_UNSIGNED_SHORT_1_5_5_5_REV
GL_VERSION_1_2, GL_EXT_read_format_bgra Alias for: GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT Define "GL_UNSI...
Definition: GL2GL3.java:465
static final int GL_PACK_SKIP_IMAGES
GL_VERSION_1_2, GL_EXT_texture3D Alias for: GL_PACK_SKIP_IMAGES_EXT Define "GL_PACK_SKIP_IMAGES" wit...
Definition: GL2GL3.java:220
static final int GL_BLUE_INTEGER
GL_VERSION_3_0, GL_EXT_texture_integer Alias for: GL_BLUE_INTEGER_EXT Define "GL_BLUE_INTEGER" with ...
Definition: GL2GL3.java:229
static final int GL_BGR_INTEGER
GL_VERSION_3_0, GL_EXT_texture_integer Alias for: GL_BGR_INTEGER_EXT Define "GL_BGR_INTEGER" with ex...
Definition: GL2GL3.java:436
static final int GL_GREEN_INTEGER
GL_VERSION_3_0, GL_EXT_texture_integer Alias for: GL_GREEN_INTEGER_EXT Define "GL_GREEN_INTEGER" wit...
Definition: GL2GL3.java:45
static final int GL_UNSIGNED_BYTE_2_3_3_REV
GL_VERSION_1_2 Define "GL_UNSIGNED_BYTE_2_3_3_REV" with expression '0x8362', CType: int
Definition: GL2GL3.java:662
static final int GL_ABGR_EXT
GL_EXT_abgr Define "GL_ABGR_EXT" with expression '0x8000', CType: int
Definition: GL2.java:941
static final int GL_SIGNED_HILO_NV
GL_NV_texture_shader Define "GL_SIGNED_HILO_NV" with expression '0x86F9', CType: int
Definition: GL2.java:2506
static final int GL_HILO_NV
GL_NV_texture_shader Define "GL_HILO_NV" with expression '0x86F4', CType: int
Definition: GL2.java:1400
static final int GL_UNSIGNED_SHORT_8_8_APPLE
GL_APPLE_ycbcr_422, GL_APPLE_rgb_422 Define "GL_UNSIGNED_SHORT_8_8_APPLE" with expression '0x85BA',...
Definition: GL2.java:1658
static final int GL_UNSIGNED_SHORT_8_8_REV_APPLE
GL_APPLE_ycbcr_422, GL_APPLE_rgb_422 Define "GL_UNSIGNED_SHORT_8_8_REV_APPLE" with expression '0x85BB...
Definition: GL2.java:747
static final int GL_YCBCR_422_APPLE
GL_APPLE_ycbcr_422 Define "GL_YCBCR_422_APPLE" with expression '0x85B9', CType: int
Definition: GL2.java:874
static final int GL_COLOR_INDEX
GL_VERSION_1_0 Define "GL_COLOR_INDEX" with expression '0x1900', CType: int
Definition: GL2.java:2227
static final int GL_HILO16_NV
GL_NV_texture_shader Define "GL_HILO16_NV" with expression '0x86F8', CType: int
Definition: GL2.java:2409
static final int GL_SIGNED_HILO16_NV
GL_NV_texture_shader Define "GL_SIGNED_HILO16_NV" with expression '0x86FA', CType: int
Definition: GL2.java:701
static final int GL_BITMAP
GL_VERSION_1_0 Define "GL_BITMAP" with expression '0x1A00', CType: int
Definition: GL2.java:1654
boolean isGL2GL3()
Indicates whether this GL object conforms to a GL2GL3 compatible profile.
boolean isGL3ES3()
Indicates whether this GL object conforms to a GL3ES3 compatible profile.
boolean isGL2ES3()
Indicates whether this GL object conforms to a either a GL2GL3 or GL3ES3 compatible profile.
GLContext getContext()
Returns the GLContext associated which this GL object.
static final int GL_HALF_FLOAT_OES
GL_OES_texture_half_float Define "GL_HALF_FLOAT_OES" with expression '0x8D61', CType: int
Definition: GLES2.java:666
static final int GL_UNSIGNED_SHORT_4_4_4_4
GL_ES_VERSION_2_0, GL_VERSION_1_2, GL_VERSION_ES_1_0, GL_EXT_packed_pixels Alias for: GL_UNSIGNED_SHO...
Definition: GL.java:444
void glGetIntegerv(int pname, IntBuffer data)
Entry point to C language function: void {@native glGetIntegerv}(GLenum pname, GLint * data) Part ...
static final int GL_BGRA
GL_VERSION_1_2, GL_IMG_read_format, GL_APPLE_texture_format_BGRA8888, GL_EXT_texture_format_BGRA8888,...
Definition: GL.java:404
static final int GL_UNPACK_ALIGNMENT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_UNPACK_ALIGNMENT" wit...
Definition: GL.java:746
static final int GL_RGB
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_RGB" with expression ...
Definition: GL.java:374
static final int GL_UNSIGNED_INT_10F_11F_11F_REV
Part of GL_ES_VERSION_3_0, GL_VERSION_3_0; GL_EXT_packed_float
Definition: GL.java:1283
static final int GL_FIXED
GL_ARB_ES2_compatibility, GL_ES_VERSION_2_0, GL_VERSION_4_1, GL_VERSION_ES_1_0, GL_OES_fixed_point Al...
Definition: GL.java:148
static final int GL_LUMINANCE_ALPHA
GL_ES_VERSION_2_0, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_LUMINANCE_ALPHA" with expression '0x1...
Definition: GL.java:624
static final int GL_DEPTH_STENCIL
GL_ES_VERSION_3_0, GL_ARB_framebuffer_object, GL_VERSION_3_0, GL_OES_packed_depth_stencil,...
Definition: GL.java:710
static final int GL_SHORT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_SHORT" with expressio...
Definition: GL.java:125
static final int GL_UNSIGNED_INT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_OES_element_index_uint Define "GL_UNSIGNED_INT"...
Definition: GL.java:294
static final int GL_FLOAT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_FLOAT" with expressio...
Definition: GL.java:786
static final int GL_LUMINANCE
GL_ES_VERSION_2_0, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_LUMINANCE" with expression '0x1909',...
Definition: GL.java:216
static final int GL_UNSIGNED_SHORT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_UNSIGNED_SHORT" with ...
Definition: GL.java:346
static final int GL_UNSIGNED_SHORT_5_5_5_1
GL_ES_VERSION_2_0, GL_VERSION_1_2, GL_VERSION_ES_1_0, GL_EXT_packed_pixels Alias for: GL_UNSIGNED_SHO...
Definition: GL.java:462
static final int GL_BGR
GL_VERSION_1_2, GL_EXT_bgra Alias for: GL_BGR_EXT Define "GL_BGR" with expression '0x80E0',...
Definition: GL.java:399
static final int GL_HALF_FLOAT
Part of GL_ARB_half_float_vertex; GL_NV_half_float; GL_ARB_half_float_pixel, earmarked for ES 3....
Definition: GL.java:1278
static final int GL_ALPHA
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_ALPHA" with expressio...
Definition: GL.java:643
static final int GL_PACK_ALIGNMENT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_PACK_ALIGNMENT" with ...
Definition: GL.java:262
static final int GL_UNSIGNED_SHORT_5_6_5
GL_ES_VERSION_2_0, GL_VERSION_1_2, GL_VERSION_ES_1_0 Define "GL_UNSIGNED_SHORT_5_6_5" with expression...
Definition: GL.java:328
static final int GL_RGBA
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_RGBA" with expression...
Definition: GL.java:150
static final int GL_UNSIGNED_INT_24_8
GL_ES_VERSION_3_0, GL_ARB_framebuffer_object, GL_VERSION_3_0, GL_NV_packed_depth_stencil,...
Definition: GL.java:763
static final int GL_UNSIGNED_BYTE
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_UNSIGNED_BYTE" with e...
Definition: GL.java:284
static final int GL_BYTE
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_BYTE" with expression...
Definition: GL.java:159