Search in sources :

Example 1 with GL2ES3

use of com.jogamp.opengl.GL2ES3 in project artisynth_core by artisynth.

the class GLSLTextureRaster method dispose.

public void dispose(final GL2ES2 gl) {
    if (null != pmvMatrixUniform) {
        pmvMatrixUniform = null;
    }
    pmvMatrix = null;
    if (null != interleavedVBO) {
        interleavedVBO.destroy(gl);
        interleavedVBO = null;
    }
    if (null != sp) {
        sp.destroy(gl);
        sp = null;
    }
    if (VAO != -1 && gl.isGL2ES3()) {
        GL2ES3 gl3 = gl.getGL2ES3();
        int[] buff = new int[] { VAO };
        gl3.glDeleteVertexArrays(1, buff, 0);
    }
}
Also used : GL2ES3(com.jogamp.opengl.GL2ES3)

Example 2 with GL2ES3

use of com.jogamp.opengl.GL2ES3 in project artisynth_core by artisynth.

the class GLSLTextureRaster method display.

public void display(final GL2ES2 gl) {
    if (null != sp) {
        sp.useProgram(gl, true);
        if (gl.isGL2ES3()) {
            GL2ES3 gl3 = gl.getGL2ES3();
            if (VAO == -1) {
                int[] buff = new int[1];
                gl3.glGenVertexArrays(1, buff, 0);
                VAO = buff[0];
            }
            // bind vertex array
            gl3.glBindVertexArray(VAO);
        }
        interleavedVBO.enableBuffer(gl, true);
        gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
        interleavedVBO.enableBuffer(gl, false);
        sp.useProgram(gl, false);
        if (gl.isGL2ES3()) {
            GL2ES3 gl3 = gl.getGL2ES3();
            // unbind vertex array
            gl3.glBindVertexArray(0);
        }
    }
}
Also used : GL2ES3(com.jogamp.opengl.GL2ES3)

Aggregations

GL2ES3 (com.jogamp.opengl.GL2ES3)2