Pipelined_QuadRenderer() { final GL2 gl = GLContext.getCurrentGL().getGL2(); mVertCoords = Buffers.newDirectFloatBuffer(kTotalBufferSizeCoordsVerts); mTexCoords = Buffers.newDirectFloatBuffer(kTotalBufferSizeCoordsTex); usingVBOs = getUseVertexArrays() && is15Available(gl); if (usingVBOs) { try { final int[] vbos = new int[2]; gl.glGenBuffers(2, IntBuffer.wrap(vbos)); mVBO_For_ResuableTileVertices = vbos[0]; mVBO_For_ResuableTileTexCoords = vbos[1]; gl.glBindBuffer(GL.GL_ARRAY_BUFFER, mVBO_For_ResuableTileVertices); gl.glBufferData(GL.GL_ARRAY_BUFFER, kTotalBufferSizeBytesVerts, null, GL2ES2.GL_STREAM_DRAW); // stream draw because this is a single quad use pipeline gl.glBindBuffer(GL.GL_ARRAY_BUFFER, mVBO_For_ResuableTileTexCoords); gl.glBufferData(GL.GL_ARRAY_BUFFER, kTotalBufferSizeBytesTex, null, GL2ES2.GL_STREAM_DRAW); // stream draw because this is a single quad use pipeline } catch (final Exception e) { isExtensionAvailable_GL_VERSION_1_5 = false; usingVBOs = false; } } }
gl.glBindBuffer(GL_ARRAY_BUFFER, vbo[0]); gl.glBindBuffer(GL_ARRAY_BUFFER, vbo[0]); gl.glBufferData(GL_ARRAY_BUFFER, (int) interleavedColorAndPositionsTemp.getValidBytes(), interleavedColorAndPositionsTemp.getByteBuffer(), GL2.GL_DYNAMIC_COPY); gl.glBindBuffer(GL_ARRAY_BUFFER, 0);
gl.glBufferData(GL.GL_ARRAY_BUFFER, shared.rel.size() // Number of lines * * 2 // 2 Points * * 5 // 2 coordinates + 3 color
gl.glGenBuffers(1, VBO, 0); // Get A Valid Name gl.glBindBuffer(GL.GL_ARRAY_BUFFER, VBO[0]); // Bind The Buffer gl.glBufferData(GL.GL_ARRAY_BUFFER, bufferSize * 4 /*SIZEOF_FLOAT*/, buffer, GL2.GL_DYNAMIC_READ);