本文整理汇总了Java中android.opengl.GLES20.GL_TEXTURE6属性的典型用法代码示例。如果您正苦于以下问题:Java GLES20.GL_TEXTURE6属性的具体用法?Java GLES20.GL_TEXTURE6怎么用?Java GLES20.GL_TEXTURE6使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.opengl.GLES20
的用法示例。
在下文中一共展示了GLES20.GL_TEXTURE6属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDraw
@Override
public void onDraw(int cameraTexId, int canvasWidth, int canvasHeight) {
// TODO move?
if (bufA == null || bufA.getWidth() != canvasWidth || bufB.getHeight() != canvasHeight) {
// Create new textures for buffering
bufA = new RenderBuffer(canvasWidth, canvasHeight, GLES20.GL_TEXTURE4);
bufB = new RenderBuffer(canvasWidth, canvasHeight, GLES20.GL_TEXTURE5);
bufC = new RenderBuffer(canvasWidth, canvasHeight, GLES20.GL_TEXTURE6);
}
// Render to buf a
setupShaderInputs(programA,
new int[]{canvasWidth, canvasHeight},
new int[]{cameraTexId, bufA.getTexId()},
new int[][]{new int[]{canvasWidth, canvasHeight}, new int[]{canvasWidth, canvasHeight}});
bufA.bind();
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
bufA.unbind();
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
// Render to buf b
setupShaderInputs(programB,
new int[]{canvasWidth, canvasHeight},
new int[]{bufB.getTexId(), bufA.getTexId()},
new int[][]{new int[]{canvasWidth, canvasHeight}, new int[]{canvasWidth, canvasHeight}});
bufB.bind();
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
bufB.unbind();
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
// Render to buf c
setupShaderInputs(programC,
new int[]{canvasWidth, canvasHeight},
new int[]{bufC.getTexId(), bufB.getTexId()},
new int[][]{new int[]{canvasWidth, canvasHeight}, new int[]{canvasWidth, canvasHeight}});
bufC.bind();
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
bufC.unbind();
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
// Render to screen
setupShaderInputs(programImg,
new int[]{canvasWidth, canvasHeight},
new int[]{bufC.getTexId(), bufA.getTexId()},
new int[][]{new int[]{canvasWidth, canvasHeight}, new int[]{canvasWidth, canvasHeight}});
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
}