Package javax.media.opengl

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


    public static void setBoundVBO(final RendererRecord rendRecord, final int id) {
        final GL gl = GLContext.getCurrentGL();

        if (!rendRecord.isVboValid() || rendRecord.getCurrentVboId() != id) {
            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, id);
            rendRecord.setCurrentVboId(id);
            rendRecord.setVboValid(true);
        }
    }
View Full Code Here


    public static void setBoundElementVBO(final RendererRecord rendRecord, final int id) {
        final GL gl = GLContext.getCurrentGL();

        if (!rendRecord.isElementVboValid() || rendRecord.getCurrentElementVboId() != id) {
            gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, id);
            rendRecord.setCurrentElementVboId(id);
            rendRecord.setElementVboValid(true);
        }
    }
View Full Code Here

   */
  public static int generateNormalsVBO(PApplet pa, FloatBuffer normalsBuffer, int normalsCount){
    int[] vboNormals = new int[1];
    GL gl =((PGraphicsOpenGL)pa.g).gl;
      gl.glGenBuffers(1, vboNormals, 0)// Get A Valid Name
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNormals[0])// Bind The Buffer
      // Load The Data
      gl.glBufferData(GL.GL_ARRAY_BUFFER, normalsCount * 3 * BufferUtil.SIZEOF_FLOAT, normalsBuffer, 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

      gl.glGenBuffers(1, vboNormals, 0)// Get A Valid Name
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNormals[0])// Bind The Buffer
      // Load The Data
      gl.glBufferData(GL.GL_ARRAY_BUFFER, normalsCount * 3 * BufferUtil.SIZEOF_FLOAT, normalsBuffer, GL.GL_STATIC_DRAW);
      //Unbind VBOs
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
      gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
    return vboNormals[0];
  }
 
 
View Full Code Here

      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboNormals[0])// Bind The Buffer
      // Load The Data
      gl.glBufferData(GL.GL_ARRAY_BUFFER, normalsCount * 3 * BufferUtil.SIZEOF_FLOAT, normalsBuffer, GL.GL_STATIC_DRAW);
      //Unbind VBOs
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
      gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
    return vboNormals[0];
  }
 
 
  /**
 
View Full Code Here

   * @param normalsCount the normals count
   * @param vboName the vbo name
   */
  public static void updateNormalsVBO(PApplet pa, FloatBuffer normalsBuffer, int normalsCount, 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, normalsCount * 3 * BufferUtil.SIZEOF_FLOAT, normalsBuffer, 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

    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, normalsCount * 3 * BufferUtil.SIZEOF_FLOAT, normalsBuffer, 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

    gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboName)// Bind The Buffer
    // Load The Data
    gl.glBufferData(GL.GL_ARRAY_BUFFER, normalsCount * 3 * BufferUtil.SIZEOF_FLOAT, normalsBuffer, 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

   */
  public static int generateVertexVBO(PApplet pa, FloatBuffer vertexBuffer, int vertexCount){
    int[] vboVertices = new int[1];
    GL gl =((PGraphicsOpenGL)pa.g).gl;
      gl.glGenBuffers(1, vboVertices, 0)// Get A Valid Name
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboVertices[0])// Bind The Buffer
      // Load The Data
      gl.glBufferData(GL.GL_ARRAY_BUFFER, vertexCount * 3 * BufferUtil.SIZEOF_FLOAT, vertexBuffer, 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

      gl.glGenBuffers(1, vboVertices, 0)// Get A Valid Name
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboVertices[0])// Bind The Buffer
      // Load The Data
      gl.glBufferData(GL.GL_ARRAY_BUFFER, vertexCount * 3 * BufferUtil.SIZEOF_FLOAT, vertexBuffer, GL.GL_STATIC_DRAW);
      //Unbind VBOs
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
      gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
    return vboVertices[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.