@Override public void glBindBuffer(int arg0,int arg1) { downstreamGL2ES2.glBindBuffer(arg0,arg1); } @Override
private final void relocateAttribute(final GL2ES2 gl, final GLArrayData attribute) { // get new location .. note: 'activeAttribLocationMap' is cleared before final String name = attribute.getName(); final int loc = attribute.setLocation(gl, shaderProgram.program()); if(0<=loc) { activeAttribLocationMap.put(name, Integer.valueOf(loc)); if(DEBUG) { System.err.println("ShaderState: relocateAttribute: "+name+", loc: "+loc); } if(isVertexAttribArrayEnabled(name)) { // enable attrib, VBO and pass location/data gl.glEnableVertexAttribArray(loc); } if( attribute.isVBO() ) { gl.glBindBuffer(GL.GL_ARRAY_BUFFER, attribute.getVBOName()); gl.glVertexAttribPointer(attribute); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0); } else { gl.glVertexAttribPointer(attribute); } } }
private final void setAttribute(final GL2ES2 gl, final GLArrayData attribute) { // get new location .. final String name = attribute.getName(); final int loc = attribute.getLocation(); if(0<=loc) { bindAttribLocation(gl, loc, name); if(isVertexAttribArrayEnabled(name)) { // enable attrib, VBO and pass location/data gl.glEnableVertexAttribArray(loc); } if( attribute.isVBO() ) { gl.glBindBuffer(GL.GL_ARRAY_BUFFER, attribute.getVBOName()); gl.glVertexAttribPointer(attribute); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0); } else { gl.glVertexAttribPointer(attribute); } } }
throw new InternalError("Using VBO but no vboName"); glsl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboName); if(!bufferWritten) { writeBuffer(gl); glsl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName()); if(null!=buffer) { glsl.glBufferData(ad.getVBOTarget(), ad.getSizeInBytes(), buffer, ad.getVBOUsage()); glsl.glBindBuffer(ad.getVBOTarget(), 0); } else { glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName()); glsl.glVertexAttribPointer(ad); glsl.glBindBuffer(ad.getVBOTarget(), 0);
glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName()); if(null!=buffer) { glsl.glBufferData(ad.getVBOTarget(), ad.getSizeInBytes(), buffer, ad.getVBOUsage()); glsl.glBindBuffer(ad.getVBOTarget(), 0); } else if(st.getAttribLocation(glsl, ad) >= 0) { glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName()); st.vertexAttribPointer(glsl, ad); glsl.glBindBuffer(ad.getVBOTarget(), 0);
gl.glBindBuffer( GL_ARRAY_BUFFER, dChunk.verticesHandle ); gl.glVertexAttribPointer( handles.inAreaVertex, coordsPerRenderTriangleVertex, GL_FLOAT, false, 0, group.trianglesCoordFirst * SIZEOF_FLOAT ); gl.glBindBuffer( GL_ARRAY_BUFFER, dChunk.verticesHandle ); gl.glVertexAttribPointer( handles.inLineVertex, coordsPerRenderLineVertex, GL_FLOAT, false, 0, group.linesCoordFirst * SIZEOF_FLOAT ); gl.glBindBuffer( GL_ARRAY_BUFFER, dChunk.verticesHandle ); gl.glVertexAttribPointer( handles.inIconVertex, coordsPerRenderIconVertex, GL_FLOAT, false, 0, group.iconsCoordFirst * SIZEOF_FLOAT ); gl.glBindBuffer( GL_ARRAY_BUFFER, dChunk.verticesHandle ); gl.glVertexAttribPointer( handles.inLabelVertex, coordsPerRenderLabelVertex, GL_FLOAT, false, 0, group.labelsCoordFirst * SIZEOF_FLOAT ); gl.glBindBuffer( GL_ARRAY_BUFFER, dLabelAtlas.entriesAlignHandle ); gl.glVertexAttribPointer( handles.inImageAlign, coordsPerLabelAtlasAlign, GL_FLOAT, false, 0, group.labelFirst * coordsPerLabelAtlasAlign * SIZEOF_FLOAT ); gl.glBindBuffer( GL_ARRAY_BUFFER, dLabelAtlas.entriesBoundsHandle ); gl.glVertexAttribPointer( handles.inImageBounds, coordsPerLabelAtlasBounds, GL_FLOAT, false, 0, group.labelFirst * coordsPerLabelAtlasBounds * SIZEOF_FLOAT );
throw new InternalError("Using VBO but no vboName"); glsl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboName); if(!bufferWritten) { writeBuffer(gl); glsl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);