Examples of glBufferData()


Examples of javax.media.opengl.GL.glBufferData()

   */
  public static void updateColorVBO(PApplet pa, FloatBuffer colorBuffer, int vertexCount, int vboName){
    GL gl =((PGraphicsOpenGL)pa.g).gl;
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboName); // Bind The Buffer
      // Load The Data
      gl.glBufferData(GL.GL_ARRAY_BUFFER, vertexCount * 4 * BufferUtil.SIZEOF_FLOAT, colorBuffer, GL.GL_STATIC_DRAW);
      //Unbind VBOs
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
      gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
  }
 
View Full Code Here

Examples of javax.media.opengl.GL.glBufferData()

    int[] vboStrokeColor = new int[1];// stroke Coordinate VBO Name
    GL gl =((PGraphicsOpenGL)pa.g).gl;
      gl.glGenBuffers(1, vboStrokeColor, 0)// Get A Valid Name
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboStrokeColor[0]); // Bind The Buffer
      // Load The Data
      gl.glBufferData(GL.GL_ARRAY_BUFFER,vertexCount * 4 * BufferUtil.SIZEOF_FLOAT, strokeColBuffer, GL.GL_STATIC_DRAW);
      //Unbind VBOs
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
      gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
    return vboStrokeColor[0];
  }
View Full Code Here

Examples of javax.media.opengl.GL.glBufferData()

   */
  public static void updateStrokeColorVBO(PApplet pa, FloatBuffer strokeColBuffer, int vertexCount, int vboName){
    GL gl =((PGraphicsOpenGL)pa.g).gl;
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboName); // Bind The Buffer
      // Load The Data
      gl.glBufferData(GL.GL_ARRAY_BUFFER,vertexCount * 4 * BufferUtil.SIZEOF_FLOAT, strokeColBuffer, GL.GL_STATIC_DRAW);
      //Unbind VBOs
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
      gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
  }
 
View Full Code Here

Examples of javax.media.opengl.GL2.glBufferData()

            glData.rewind();

            // create and write GL buffer
            gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
                gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, id[0]);
                gl.glBufferData(GL2.GL_ARRAY_BUFFER, glData.capacity()*4, glData, GL2.GL_STATIC_DRAW);
                gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
            gl.glDisableClientState(GL2.GL_VERTEX_ARRAY);
            gl.glFinish();
           

View Full Code Here

Examples of javax.media.opengl.GL2.glBufferData()

    //        gl.glBufferData(GL2.GL_ELEMENT_ARRAY_BUFFER, ib.capacity() * SIZEOF_INT, ib, GL2.GL_STATIC_DRAW);
    //        gl.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, 0);

            gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
                gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, glObjects[VERTICES]);
                gl.glBufferData(GL2.GL_ARRAY_BUFFER, BUFFER_SIZE, null, GL2.GL_DYNAMIC_DRAW);
                gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
            gl.glDisableClientState(GL2.GL_VERTEX_ARRAY);

            pushPerspectiveView(gl);
            gl.glFinish();
View Full Code Here

Examples of javax.microedition.khronos.opengles.GL11.glBufferData()

        _buffers = new int[2];

        final GL11 gl = (GL11) g;
        gl.glGenBuffers(2, _buffers, 0);
        gl.glBindBuffer(GL11.GL_ARRAY_BUFFER, _buffers[0]);
        gl.glBufferData(GL11.GL_ARRAY_BUFFER, _verticesSize + _normalsSize
                + _texcoordsSize, vertices, GL11.GL_STATIC_DRAW);
        gl.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, _buffers[1]);
        gl.glBufferData(GL11.GL_ELEMENT_ARRAY_BUFFER, _indicesSize, indices,
                GL11.GL_STATIC_DRAW);
        gl.glBindBuffer(GL11.GL_ARRAY_BUFFER, 0);
View Full Code Here

Examples of javax.microedition.khronos.opengles.GL11.glBufferData()

        gl.glGenBuffers(2, _buffers, 0);
        gl.glBindBuffer(GL11.GL_ARRAY_BUFFER, _buffers[0]);
        gl.glBufferData(GL11.GL_ARRAY_BUFFER, _verticesSize + _normalsSize
                + _texcoordsSize, vertices, GL11.GL_STATIC_DRAW);
        gl.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, _buffers[1]);
        gl.glBufferData(GL11.GL_ELEMENT_ARRAY_BUFFER, _indicesSize, indices,
                GL11.GL_STATIC_DRAW);
        gl.glBindBuffer(GL11.GL_ARRAY_BUFFER, 0);
        gl.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, 0);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.