Example usage for android.opengl GLES20 GL_TRIANGLE_FAN

List of usage examples for android.opengl GLES20 GL_TRIANGLE_FAN

Introduction

In this page you can find the example usage for android.opengl GLES20 GL_TRIANGLE_FAN.

Prototype

int GL_TRIANGLE_FAN

To view the source code for android.opengl GLES20 GL_TRIANGLE_FAN.

Click Source Link

Usage

From source file:com.google.fpl.liquidfunpaint.renderer.ScreenRenderer.java

/**
 * Draw function for the geometry that this class owns.
 *///from   w w w . ja v a 2  s  .  c om
public void draw(float[] transformFromTexture) {
    RenderHelper.SCREEN_QUAD_VERTEX_BUFFER.rewind();

    mMaterial.beginRender();

    // Set attribute arrays
    mMaterial.setVertexAttributeBuffer("aPosition", RenderHelper.SCREEN_QUAD_VERTEX_BUFFER, 0);
    mMaterial.setVertexAttributeBuffer("aTexCoord", RenderHelper.SCREEN_QUAD_VERTEX_BUFFER, 3);

    // Set per draw uniforms
    GLES20.glUniformMatrix4fv(mMaterial.getUniformLocation("uMvpTransform"), 1, false, transformFromTexture, 0);
    GLES20.glUniform1f(mMaterial.getUniformLocation("uAlphaThreshold"), mAlphaThreshold);

    GLES20.glDrawArrays(GLES20.GL_TRIANGLE_FAN, 0, 4);

    mMaterial.endRender();
}