Package javax.media.opengl

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


    private static int makeVBOId() {
        final GL gl = GLContext.getCurrentGL();

        final IntBuffer idBuff = BufferUtils.createIntBuffer(1);
        gl.glGenBuffers(1, idBuff);
        return idBuff.get(0);
    }

    public void unbindVBO() {
        final RenderContext context = ContextManager.getCurrentContext();
View Full Code Here


   * @return the int
   */
  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);
View Full Code Here

   * @return the int
   */
  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);
View Full Code Here

   * @return the int
   */
  public static int generateTextureVBO(PApplet pa, FloatBuffer textureBuffer, int vertexCount){
    int[] vboTexCoords = new int[1];// Texture Coordinate VBO Name
    GL gl =((PGraphicsOpenGL)pa.g).gl;
      gl.glGenBuffers(1, vboTexCoords, 0)// Get A Valid Name
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboTexCoords[0]); // Bind The Buffer
      // Load The Data
      gl.glBufferData(GL.GL_ARRAY_BUFFER, vertexCount * 2 * BufferUtil.SIZEOF_FLOAT, textureBuffer, GL.GL_STATIC_DRAW);
      //Unbind VBOs
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
View Full Code Here

   * @return the int
   */
  public static int generateColorVBO(PApplet pa, FloatBuffer colorBuffer, int vertexCount){
    int[] vboColor = new int[1];// vertexcolor Coordinate VBO Name
    GL gl =((PGraphicsOpenGL)pa.g).gl;
      gl.glGenBuffers(1, vboColor, 0)// Get A Valid Name
      gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboColor[0]); // 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);
View Full Code Here

   * @return the int
   */
  public static int generateStrokeColorVBO(PApplet pa, FloatBuffer strokeColBuffer, int vertexCount){
    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);
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.