JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
TextureSequenceES2.java
Go to the documentation of this file.
1/**
2 * Copyright 2012-2023 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28
29package com.jogamp.opengl.demos.es2;
30
31import java.nio.FloatBuffer;
32
33import com.jogamp.common.os.Platform;
34import com.jogamp.math.FloatUtil;
35import com.jogamp.math.Recti;
36import com.jogamp.math.Vec3f;
37import com.jogamp.opengl.GL;
38import com.jogamp.opengl.GL2ES2;
39import com.jogamp.opengl.GLAutoDrawable;
40import com.jogamp.opengl.GLES2;
41import com.jogamp.opengl.GLEventListener;
42import com.jogamp.opengl.GLException;
43import com.jogamp.opengl.GLExtensions;
44import com.jogamp.opengl.GLUniformData;
45import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
46import com.jogamp.opengl.util.GLArrayDataServer;
47import com.jogamp.opengl.util.PMVMatrix;
48import com.jogamp.opengl.util.glsl.ShaderCode;
49import com.jogamp.opengl.util.glsl.ShaderProgram;
50import com.jogamp.opengl.util.glsl.ShaderState;
51import com.jogamp.opengl.util.texture.Texture;
52import com.jogamp.opengl.util.texture.TextureCoords;
53import com.jogamp.opengl.util.texture.TextureSequence;
54import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
55
56/**
57 * Simple planar movie player w/ orthogonal 1:1 projection.
58 */
59public class TextureSequenceES2 implements GLEventListener {
60 public static final int EFFECT_NORMAL = 0;
61 public static final int EFFECT_GRADIENT_BOTTOM2TOP = 1<<1;
62 public static final int EFFECT_TRANSPARENT = 1<<3;
63
64 private TextureSequence texSeq;
65 private final boolean texSeqShared;
66 private ShaderState st;
67 private PMVMatrix pmvMatrix;
68 private GLUniformData pmvMatrixUniform;
69
70 private float zrot = 0f;
71 private final boolean orthoProjection;
72 private float nearPlaneNormalized;
73 private float zoom;
74
75 private int effects = EFFECT_NORMAL;
76 private float alpha = 1.0f;
77
78 private boolean useOriginalScale = false;
79 private float[] verts = null;
80 private GLArrayDataServer interleavedVBO;
81
82 public TextureSequenceES2(final TextureSequence texSource, final boolean texSeqShared, final boolean orthoProjection, final float zoom0) throws IllegalStateException {
83 this.texSeq = texSource;
84 this.texSeqShared = texSeqShared;
85 this.orthoProjection = orthoProjection;
86 this.zoom = zoom0;
87 }
88
89 public void setZoom(final float zoom) { this.zoom = zoom; }
90 public float getZoom() { return zoom; }
91 public void setZRotation(final float zrot) { this.zrot = zrot; }
92 public boolean hasEffect(final int e) { return 0 != ( effects & e ) ; }
93 public void setEffects(final int e) { effects = e; };
94 public void setTransparency(final float alpha) {
95 this.effects |= EFFECT_TRANSPARENT;
96 this.alpha = alpha;
97 }
98 public void setUseOriginalScale(final boolean v) {
99 useOriginalScale = v;
100 }
101
102 private static final String shaderBasename = "texsequence_xxx";
103 private static final String myTextureLookupName = "myTexture2D";
104
105 private void initShader(final GL2ES2 gl) {
106 // Create & Compile the shader objects
107 final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
108 "shader", "shader/bin", shaderBasename, true);
109 final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
110 "shader", "shader/bin", shaderBasename, true);
111
112 boolean preludeGLSLVersion = true;
115 throw new GLException(GLExtensions.OES_EGL_image_external+" requested but not available");
116 }
117 if( Platform.OSType.ANDROID == Platform.getOSType() && gl.isGLES3() ) {
118 // Bug on Nexus 10, ES3 - Android 4.3, where
119 // GL_OES_EGL_image_external extension directive leads to a failure _with_ '#version 300 es' !
120 // P0003: Extension 'GL_OES_EGL_image_external' not supported
121 preludeGLSLVersion = false;
122 }
123 }
124 rsVp.defaultShaderCustomization(gl, preludeGLSLVersion, true);
125
126 int rsFpPos = preludeGLSLVersion ? rsFp.addGLSLVersion(gl) : 0;
127 rsFpPos = rsFp.insertShaderSource(0, rsFpPos, texSeq.getRequiredExtensionsShaderStub());
128 rsFp.addDefaultShaderPrecision(gl, rsFpPos);
129
130 final String texLookupFuncName = texSeq.setTextureLookupFunctionName(myTextureLookupName);
131 rsFp.replaceInShaderSource(myTextureLookupName, texLookupFuncName);
132
133 // Inject TextureSequence shader details
134 final StringBuilder sFpIns = new StringBuilder();
135 sFpIns.append("uniform ").append(texSeq.getTextureSampler2DType()).append(" mgl_ActiveTexture;\n");
136 sFpIns.append(texSeq.getTextureLookupFragmentShaderImpl());
137 rsFp.insertShaderSource(0, "TEXTURE-SEQUENCE-CODE-BEGIN", 0, sFpIns);
138
139 // Create & Link the shader program
140 final ShaderProgram sp = new ShaderProgram();
141 sp.add(rsVp);
142 sp.add(rsFp);
143 if(!sp.link(gl, System.err)) {
144 throw new GLException("Couldn't link program: "+sp);
145 }
146
147 // Let's manage all our states using ShaderState.
148 st = new ShaderState();
149 st.attachShaderProgram(gl, sp, false);
150 }
151
152 @Override
153 public void init(final GLAutoDrawable drawable) {
154 if(null == texSeq) {
155 throw new InternalError("texSeq null");
156 }
157 final GL2ES2 gl = drawable.getGL().getGL2ES2();
158 final TextureFrame frame = texSeq.getLastTexture();
159 if( null == frame ) {
160 return;
161 }
162 final Texture tex = frame.getTexture();
163
164 initShader(gl);
165
166 // Push the 1st uniform down the path
167 st.useProgram(gl, true);
168
169 final Recti viewPort = new Recti(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
170 pmvMatrix = new PMVMatrix();
171 reshapePMV(viewPort.width(), viewPort.height());
172 pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.getSyncPMv());
173 if(!st.uniform(gl, pmvMatrixUniform)) {
174 throw new GLException("Error setting PMVMatrix in shader: "+st);
175 }
176 if(!st.uniform(gl, new GLUniformData("mgl_ActiveTexture", texSeq.getTextureUnit()))) {
177 throw new GLException("Error setting mgl_ActiveTexture in shader: "+st);
178 }
179
180 final float dWidth = drawable.getSurfaceWidth();
181 final float dHeight = drawable.getSurfaceHeight();
182 final float mWidth = tex.getImageWidth();
183 final float mHeight = tex.getImageHeight();
184 final float mAspect = mWidth/mHeight;
185 System.err.println("XXX0: mov aspect: "+mAspect);
186 float xs, ys;
187 if(orthoProjection) {
188 if(useOriginalScale && mWidth < dWidth && mHeight < dHeight) {
189 xs = mWidth/2f; ys = xs / mAspect;
190 } else {
191 xs = dWidth/2f; ys = xs / mAspect; // w>h
192 }
193 } else {
194 if(useOriginalScale && mWidth < dWidth && mHeight < dHeight) {
195 xs = mAspect * ( mWidth / dWidth ) ; ys = xs / mAspect ;
196 } else {
197 xs = mAspect; ys = 1f; // b>h
198 }
199 }
200 verts = new float[] { -1f*xs, -1f*ys, 0f, // LB
201 1f*xs, 1f*ys, 0f // RT
202 };
203 {
204 System.err.println("XXX0: pixel LB: "+verts[0]+", "+verts[1]+", "+verts[2]);
205 System.err.println("XXX0: pixel RT: "+verts[3]+", "+verts[4]+", "+verts[5]);
206 final Vec3f winLB = new Vec3f();
207 final Vec3f winRT = new Vec3f();
208 pmvMatrix.mapObjToWin(new Vec3f(verts[0], verts[1], verts[2]), viewPort, winLB);
209 pmvMatrix.mapObjToWin(new Vec3f(verts[3], verts[4], verts[5]), viewPort, winRT);
210 System.err.println("XXX0: win LB: "+winLB);
211 System.err.println("XXX0: win RT: "+winRT);
212 }
213
214 interleavedVBO = GLArrayDataServer.createGLSLInterleaved(3+4+2, GL.GL_FLOAT, false, 3*4, GL.GL_STATIC_DRAW);
215 {
216 interleavedVBO.addGLSLSubArray("mgl_Vertex", 3, GL.GL_ARRAY_BUFFER);
217 interleavedVBO.addGLSLSubArray("mgl_Color", 4, GL.GL_ARRAY_BUFFER);
218 interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
219 }
220 updateInterleavedVBO(gl, tex);
221
222 st.ownAttribute(interleavedVBO, true);
223 gl.glClearColor(0.3f, 0.3f, 0.3f, 0.3f);
224
226
227 st.useProgram(gl, false);
228
229 // Let's show the completed shader state ..
230 System.out.println("iVBO: "+interleavedVBO);
231 System.out.println(st);
232 }
233
234 protected void updateInterleavedVBO(final GL gl, final Texture tex) {
235 final float ss = 1f, ts = 1f; // scale tex-coord
236 final boolean wasEnabled = interleavedVBO.enabled();
237 interleavedVBO.seal(gl, false);
238 interleavedVBO.rewind();
239 {
240 final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
241 final TextureCoords tc = tex.getImageTexCoords();
242 System.err.println("XXX0: "+tc);
243 System.err.println("XXX0: tex aspect: "+tex.getAspectRatio());
244 System.err.println("XXX0: tex y-flip: "+tex.getMustFlipVertically());
245
246 // left-bottom
247 ib.put(verts[0]); ib.put(verts[1]); ib.put(verts[2]);
249 ib.put( 0); ib.put( 0); ib.put( 0); ib.put(alpha);
250 } else {
251 ib.put( 1); ib.put( 1); ib.put( 1); ib.put(alpha);
252 }
253 ib.put( tc.left() *ss); ib.put( tc.bottom() *ts);
254
255 // right-bottom
256 ib.put(verts[3]); ib.put(verts[1]); ib.put(verts[2]);
258 ib.put( 0); ib.put( 0); ib.put( 0); ib.put(alpha);
259 } else {
260 ib.put( 1); ib.put( 1); ib.put( 1); ib.put(alpha);
261 }
262 ib.put( tc.right() *ss); ib.put( tc.bottom() *ts);
263
264 // left-top
265 ib.put(verts[0]); ib.put(verts[4]); ib.put(verts[2]);
266 ib.put( 1); ib.put( 1); ib.put( 1); ib.put(alpha);
267 ib.put( tc.left() *ss); ib.put( tc.top() *ts);
268
269 // right-top
270 ib.put(verts[3]); ib.put(verts[4]); ib.put(verts[2]);
271 ib.put( 1); ib.put( 1); ib.put( 1); ib.put(alpha);
272 ib.put( tc.right() *ss); ib.put( tc.top() *ts);
273 }
274 interleavedVBO.seal(gl, true);
275 if( !wasEnabled ) {
276 interleavedVBO.enableBuffer(gl, false);
277 }
278 }
279
280 @Override
281 public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
282 final GL2ES2 gl = drawable.getGL().getGL2ES2();
283
284 if(null != st) {
285 reshapePMV(width, height);
286 st.useProgram(gl, true);
287 st.uniform(gl, pmvMatrixUniform);
288 st.useProgram(gl, false);
289 }
290
291 System.out.println("pR "+texSeq);
292 }
293
294 private final float zNear = 1f;
295 private final float zFar = 10f;
296
297 private void reshapePMV(final int width, final int height) {
299 pmvMatrix.glLoadIdentity();
300 if(orthoProjection) {
301 final float fw = width / 2f;
302 final float fh = height/ 2f;
303 pmvMatrix.glOrthof(-fw, fw, -fh, fh, -1.0f, 1.0f);
304 nearPlaneNormalized = 0f;
305 } else {
306 pmvMatrix.gluPerspective(FloatUtil.QUARTER_PI, (float)width / (float)height, zNear, zFar);
307 nearPlaneNormalized = 1f/(10f-1f);
308 }
309 System.err.println("XXX0: Perspective nearPlaneNormalized: "+nearPlaneNormalized);
310
311 pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
312 pmvMatrix.glLoadIdentity();
313 pmvMatrix.glTranslatef(0, 0, zoom);
314 }
315
316 @Override
317 public void dispose(final GLAutoDrawable drawable) {
318 if(null == texSeq) { return; }
319 disposeImpl(drawable, true);
320 }
321 private void disposeImpl(final GLAutoDrawable drawable, final boolean disposeTexSeq) {
322 if( disposeTexSeq ) {
323 texSeq = null;
324 }
325 pmvMatrixUniform = null;
326 pmvMatrix=null;
327 if(null != st) {
328 final GL2ES2 gl = drawable.getGL().getGL2ES2();
329 st.destroy(gl);
330 st=null;
331 }
332 }
333
334 @Override
335 public void display(final GLAutoDrawable drawable) {
336 if(null == texSeq) { return; }
337 final GL2ES2 gl = drawable.getGL().getGL2ES2();
338
340
341 if(null == st) {
342 return;
343 }
344
345 st.useProgram(gl, true);
346
348 pmvMatrix.glLoadIdentity();
349 pmvMatrix.glTranslatef(0, 0, zoom);
350 if(zrot > 0f) {
351 pmvMatrix.glRotatef(zrot, 0, 0, 1);
352 } else {
353 zrot = 0;
354 }
355 st.uniform(gl, pmvMatrixUniform);
356 interleavedVBO.enableBuffer(gl, true);
357 Texture tex = null;
358 if(null!=texSeq) {
359 final TextureSequence.TextureFrame texFrame;
360 if( texSeqShared ) {
361 texFrame = texSeq.getLastTexture();
362 } else {
363 texFrame = texSeq.getNextTexture(gl);
364 }
365 if(null != texFrame) {
366 tex = texFrame.getTexture();
368 tex.enable(gl);
369 tex.bind(gl);
370 }
371 }
373 if(null != tex) {
374 tex.disable(gl);
375 }
376 interleavedVBO.enableBuffer(gl, false);
377 st.useProgram(gl, false);
378 }
379}
Basic Float math utility functions.
Definition: FloatUtil.java:83
static final float QUARTER_PI
The value PI/4, i.e.
Rectangle with x, y, width and height integer components.
Definition: Recti.java:34
3D Vector based upon three float components.
Definition: Vec3f.java:37
final SyncMatrices4f getSyncPMv()
Returns SyncMatrices4f of 2 matrices within one FloatBuffer: P and Mv.
final boolean mapObjToWin(final Vec3f objPos, final Recti viewport, final Vec3f winPos)
Map object coordinates to window coordinates.
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Class holding OpenGL extension strings, commonly used by JOGL's implementation.
static final String OES_EGL_image_external
GLSL uniform data wrapper encapsulating data to be uploaded to the GPU as a uniform.
Simple planar movie player w/ orthogonal 1:1 projection.
void display(final GLAutoDrawable drawable)
Called by the drawable to initiate OpenGL rendering by the client.
void init(final GLAutoDrawable drawable)
Called by the drawable immediately after the OpenGL context is initialized.
void updateInterleavedVBO(final GL gl, final Texture tex)
void dispose(final GLAutoDrawable drawable)
Notifies the listener to perform the release of all OpenGL resources per GLContext,...
void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height)
Called by the drawable during the first repaint after the component has been resized.
TextureSequenceES2(final TextureSequence texSource, final boolean texSeqShared, final boolean orthoProjection, final float zoom0)
void seal(final GL gl, final boolean seal)
Convenience method calling seal(boolean) and enableBuffer(GL, boolean).
void enableBuffer(final GL gl, final boolean enable)
Enables the buffer if enable is true, and transfers the data if required.
static GLArrayDataServer createGLSLInterleaved(final int compsPerElement, final int dataType, final boolean normalized, final int initialElementCount, final int vboUsage)
Create a VBO for GLSL interleaved array data starting with a new created Buffer object with initialEl...
GLArrayDataWrapper addGLSLSubArray(final String name, final int comps, final int vboTarget)
Configure a segment of this GLSL interleaved array (see createGLSLInterleaved(int,...
Buffer getBuffer()
The Buffer holding the data, may be null if a GPU buffer without client bound data.
PMVMatrix implements a subset of the fixed function pipeline GLMatrixFunc using PMVMatrix4f.
Definition: PMVMatrix.java:62
final void glTranslatef(final float x, final float y, final float z)
Translate the current matrix.
Definition: PMVMatrix.java:379
final void glMatrixMode(final int matrixName)
Sets the current matrix mode.
Definition: PMVMatrix.java:218
final void glOrthof(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar)
Multiply the current matrix with the orthogonal matrix.
Definition: PMVMatrix.java:469
final void gluPerspective(final float fovy_rad, final float aspect, final float zNear, final float zFar)
Multiply the current matrix with the perspective/frustum matrix.
Definition: PMVMatrix.java:499
final void glRotatef(final float ang_deg, final float x, final float y, final float z)
Rotate the current matrix.
Definition: PMVMatrix.java:413
final void glLoadIdentity()
Load the current matrix with the identity matrix.
Definition: PMVMatrix.java:325
Convenient shader code class to use and instantiate vertex or fragment programs.
Definition: ShaderCode.java:75
final int defaultShaderCustomization(final GL2ES2 gl, final boolean preludeVersion, final boolean addDefaultPrecision)
Default customization of this shader source code.
final int addGLSLVersion(final GL2ES2 gl)
Add GLSL version at the head of this shader source code.
static ShaderCode create(final GL2ES2 gl, final int type, final int count, final Class<?> context, final String[] sourceFiles, final boolean mutableStringBuilder)
Creates a complete ShaderCode object while reading all shader source of sourceFiles,...
int replaceInShaderSource(final String oldName, final String newName)
Replaces oldName with newName in all shader sources.
final int addDefaultShaderPrecision(final GL2ES2 gl, int pos)
Adds default precision to source code at given position if required, i.e.
int insertShaderSource(final int shaderIdx, final String tag, final int fromIndex, final CharSequence data)
Adds data after the line containing tag.
ShaderState allows to sharing data between shader programs, while updating the attribute and uniform ...
void ownAttribute(final GLArrayData attribute, final boolean own)
Binds or unbinds the GLArrayData lifecycle to this ShaderState.
synchronized void useProgram(final GL2ES2 gl, final boolean on)
Turns the shader program on or off.
synchronized boolean attachShaderProgram(final GL2ES2 gl, final ShaderProgram prog, final boolean enable)
Attach or switch a shader program.
synchronized void destroy(final GL2ES2 gl)
Calls release(gl, true, true, true).
boolean uniform(final GL2ES2 gl, final GLUniformData data)
Set the uniform data, if it's location is valid, i.e.
Specifies texture coordinates for a rectangular area of a texture.
Texture holder interface, maybe specialized by implementation to associated related data.
Represents an OpenGL texture object.
Definition: Texture.java:173
int getImageHeight()
Returns the height of the image contained within this texture.
Definition: Texture.java:459
TextureCoords getImageTexCoords()
Returns the set of texture coordinates corresponding to the entire image.
Definition: Texture.java:480
void bind(final GL gl)
Binds this texture to the given GL context.
Definition: Texture.java:377
boolean getMustFlipVertically()
Indicates whether this texture's texture coordinates must be flipped vertically in order to properly ...
Definition: Texture.java:536
void disable(final GL gl)
Disables this texture's target (e.g., GL_TEXTURE_2D) in the given GL state.
Definition: Texture.java:357
float getAspectRatio()
Returns the original aspect ratio of the image, defined as (image width) / (image height),...
Definition: Texture.java:468
void enable(final GL gl)
Enables this texture's target (e.g., GL_TEXTURE_2D) in the given GL context's state.
Definition: Texture.java:330
int getImageWidth()
Returns the width of the image contained within this texture.
Definition: Texture.java:445
static final int GL_VERTEX_SHADER
GL_ES_VERSION_2_0, GL_VERSION_2_0, GL_EXT_vertex_shader, GL_ARB_vertex_shader Alias for: GL_VERTEX_SH...
Definition: GL2ES2.java:39
static final int GL_FRAGMENT_SHADER
GL_ES_VERSION_2_0, GL_VERSION_2_0, GL_ATI_fragment_shader, GL_ARB_fragment_shader Alias for: GL_FRAGM...
Definition: GL2ES2.java:541
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
GL2ES2 getGL2ES2()
Casts this object to the GL2ES2 interface.
boolean isExtensionAvailable(String glExtensionName)
Returns true if the specified OpenGL extension can be used successfully through this GL instance give...
boolean isGLES3()
Indicates whether this GL object conforms to the OpenGL ES ≥ 3.0 profile.
int getSurfaceWidth()
Returns the width of this GLDrawable's surface client area in pixel units.
int getSurfaceHeight()
Returns the height of this GLDrawable's surface client area in pixel units.
static final int GL_TEXTURE_EXTERNAL_OES
GL_OES_EGL_image_external Define "GL_TEXTURE_EXTERNAL_OES" with expression '0x8D65',...
Definition: GLES2.java:57
Declares events which client code can use to manage OpenGL rendering into a GLAutoDrawable.
void glDrawArrays(int mode, int first, int count)
Entry point to C language function: void {@native glDrawArrays}(GLenum mode, GLint first,...
static final int GL_STATIC_DRAW
GL_VERSION_1_5, GL_ES_VERSION_2_0, GL_VERSION_ES_1_0, GL_ARB_vertex_buffer_object Alias for: GL_STATI...
Definition: GL.java:673
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_COLOR_BUFFER_BIT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_COLOR_BUFFER_BIT" wit...
Definition: GL.java:390
void glClearColor(float red, float green, float blue, float alpha)
Entry point to C language function: void {@native glClearColor}(GLfloat red, GLfloat green,...
void glEnable(int cap)
Entry point to C language function: void {@native glEnable}(GLenum cap) Part of GL_ES_VERSION_2_0,...
static final int GL_DEPTH_TEST
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_DEPTH_TEST" with expr...
Definition: GL.java:43
void glActiveTexture(int texture)
Entry point to C language function: void {@native glActiveTexture}(GLenum texture) Part of GL_ES_V...
void glClear(int mask)
Entry point to C language function: void {@native glClear}(GLbitfield mask) Part of GL_ES_VERSION_...
static final int GL_TRIANGLE_STRIP
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_TRIANGLE_STRIP" with ...
Definition: GL.java:760
static final int GL_TEXTURE0
GL_ES_VERSION_2_0, GL_VERSION_1_3, GL_VERSION_ES_1_0, GL_ARB_multitexture Alias for: GL_TEXTURE0_ARB ...
Definition: GL.java:71
static final int GL_DEPTH_BUFFER_BIT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_DEPTH_BUFFER_BIT" wit...
Definition: GL.java:738
static final int GL_ARRAY_BUFFER
GL_VERSION_1_5, GL_ES_VERSION_2_0, GL_VERSION_ES_1_0, GL_ARB_vertex_buffer_object Alias for: GL_ARRAY...
Definition: GL.java:633
Subset of OpenGL fixed function pipeline's matrix operations.
static final int GL_PROJECTION
Matrix mode projection.
static final int GL_MODELVIEW
Matrix mode modelview.
Protocol for texture sequences, like animations, movies, etc.
TextureFrame getLastTexture()
Returns the last updated texture.
int getTextureTarget()
Returns the texture target used by implementation.
String getTextureLookupFragmentShaderImpl()
Returns the complete texture2D lookup function code of type.
String getTextureSampler2DType()
Returns either sampler2D or samplerExternalOES depending on getLastTexture().
String setTextureLookupFunctionName(String texLookupFuncName)
Set the desired shader code's texture lookup function name.
int getTextureUnit()
Return the texture unit used to render the current frame.
TextureFrame getNextTexture(GL gl)
Returns the next texture to be rendered.
String getRequiredExtensionsShaderStub()
In case a shader extension is required, based on the implementation and the runtime GL profile,...