Examples of glBindBuffer()


Examples of com.badlogic.gdx.graphics.GL20.glBindBuffer()

    } else if (Gdx.gl11 != null) {
      tmpHandle.clear();
      tmpHandle.put(bufferHandle);
      tmpHandle.flip();
      GL11 gl = Gdx.gl11;
      gl.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, 0);
      gl.glDeleteBuffers(1, tmpHandle);
      bufferHandle = 0;
    }
  }
}
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20.glBindBuffer()

  @Override
  public void bind (final ShaderProgram shader, final int[] locations) {
    final GL20 gl = Gdx.gl20;

    gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, bufferHandle);
    if (isDirty) {
      byteBuffer.limit(buffer.limit() * 4);
      gl.glBufferData(GL20.GL_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage);
      isDirty = false;
    }
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20.glBindBuffer()

      for (int i = 0; i < numAttributes; i++) {
        final int location = locations[i];
        if (location >= 0) shader.disableVertexAttribute(location);
      }
    }
    gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0);
    isBound = false;
  }

  /** Invalidates the VertexBufferObject so a new OpenGL buffer handle is created. Use this in case of a context loss. */
  public void invalidate () {
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20.glBindBuffer()

  public void dispose () {
    tmpHandle.clear();
    tmpHandle.put(bufferHandle);
    tmpHandle.flip();
    GL20 gl = Gdx.gl20;
    gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0);
    gl.glDeleteBuffers(1, tmpHandle);
    bufferHandle = 0;
  }

  /** Returns the VBO handle
View Full Code Here

Examples of com.badlogic.gdx.graphics.GL20.glBindBuffer()

  @Override
  public void bind (ShaderProgram shader, int[] locations) {
    final GL20 gl = Gdx.gl20;

    gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, bufferHandle);
    if (isDirty) {
      byteBuffer.limit(buffer.limit() * 4);
      gl.glBufferData(GL20.GL_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage);
      isDirty = false;
    }
View Full Code Here

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

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

    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

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

            IntBuffer glData = Buffers.newDirectIntBuffer(new int[] {0,1,2,3,4,5,6,7,8});
            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.glBindBuffer()

            // 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();
           

            // create CLGL buffer
View Full Code Here

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

    //        gl.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, glObjects[INDICES]);
    //        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);
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.