/** * Creates the actual Buffer objects. */ public void createBuffers() { for (BufferInfo info : mBuffers) { if (info.buffer != null) { if (info.buffer instanceof FloatBuffer) { ((FloatBuffer) info.buffer).compact().position(0); } else if (info.buffer instanceof IntBuffer) { ((IntBuffer) info.buffer).compact().position(0); } else if (info.buffer instanceof ShortBuffer) { ((ShortBuffer) info.buffer).compact().position(0); } else if (info.buffer instanceof ByteBuffer) { ((ByteBuffer) info.buffer).compact().position(0); } else if (info.buffer instanceof DoubleBuffer) { ((DoubleBuffer) info.buffer).compact().position(0); } else if (info.buffer instanceof LongBuffer) { ((LongBuffer) info.buffer).compact().position(0); } else if (info.buffer instanceof CharBuffer) { ((CharBuffer) info.buffer).compact().position(0); } } createBuffer(info); } GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, 0); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0); mHaveCreatedBuffers = true; }
public IntBuffer compact() { return buf.get().compact(); }
private void fetchAttributes() { attributes.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_ATTRIBUTES, params); int numAttributes = params.get(0); for(int i=0; i<numAttributes; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveAttrib(programHandle, i, params, type); int location = GLES20.glGetAttribLocation(programHandle, name); attributes.put(name, location); } }
private void fetchUniforms() { uniforms.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_UNIFORMS, params); int numUniform = params.get(0); for(int i=0; i<numUniform; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveUniform(programHandle, i, params, type); int location = GLES20.glGetUniformLocation(programHandle, name); uniforms.put(name, location); } }
private void fetchAttributes() { attributes.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_ATTRIBUTES, params); int numAttributes = params.get(0); for(int i=0; i<numAttributes; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveAttrib(programHandle, i, params, type); int location = GLES20.glGetAttribLocation(programHandle, name); attributes.put(name, location); } }
private void fetchUniforms() { uniforms.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_UNIFORMS, params); int numUniform = params.get(0); for(int i=0; i<numUniform; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveUniform(programHandle, i, params, type); int location = GLES20.glGetUniformLocation(programHandle, name); uniforms.put(name, location); } }
private void fetchAttributes() { attributes.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_ATTRIBUTES, params); int numAttributes = params.get(0); for(int i=0; i<numAttributes; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveAttrib(programHandle, i, params, type); int location = GLES20.glGetAttribLocation(programHandle, name); attributes.put(name, location); } }
private void fetchAttributes() { attributes.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_ATTRIBUTES, params); int numAttributes = params.get(0); for(int i=0; i<numAttributes; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveAttrib(programHandle, i, params, type); int location = GLES20.glGetAttribLocation(programHandle, name); attributes.put(name, location); } }
private void fetchUniforms() { uniforms.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_UNIFORMS, params); int numUniform = params.get(0); for(int i=0; i<numUniform; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveUniform(programHandle, i, params, type); int location = GLES20.glGetUniformLocation(programHandle, name); uniforms.put(name, location); } }
private void fetchAttributes() { attributes.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_ATTRIBUTES, params); int numAttributes = params.get(0); for(int i=0; i<numAttributes; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveAttrib(programHandle, i, params, type); int location = GLES20.glGetAttribLocation(programHandle, name); attributes.put(name, location); } }
private void fetchUniforms() { uniforms.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_UNIFORMS, params); int numUniform = params.get(0); for(int i=0; i<numUniform; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveUniform(programHandle, i, params, type); int location = GLES20.glGetUniformLocation(programHandle, name); uniforms.put(name, location); } }
private void fetchUniforms() { uniforms.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_UNIFORMS, params); int numUniform = params.get(0); for(int i=0; i<numUniform; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveUniform(programHandle, i, params, type); int location = GLES20.glGetUniformLocation(programHandle, name); uniforms.put(name, location); } }
private void fetchUniforms() { uniforms.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_UNIFORMS, params); int numUniform = params.get(0); for(int i=0; i<numUniform; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveUniform(programHandle, i, params, type); int location = GLES20.glGetUniformLocation(programHandle, name); uniforms.put(name, location); } }
private void fetchUniforms() { uniforms.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_UNIFORMS, params); int numUniform = params.get(0); for(int i=0; i<numUniform; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveUniform(programHandle, i, params, type); int location = GLES20.glGetUniformLocation(programHandle, name); uniforms.put(name, location); } }
private void fetchUniforms() { uniforms.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_UNIFORMS, params); int numUniform = params.get(0); for(int i=0; i<numUniform; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveUniform(programHandle, i, params, type); int location = GLES20.glGetUniformLocation(programHandle, name); uniforms.put(name, location); } }
private void fetchAttributes() { attributes.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_ATTRIBUTES, params); int numAttributes = params.get(0); for(int i=0; i<numAttributes; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveAttrib(programHandle, i, params, type); int location = GLES20.glGetAttribLocation(programHandle, name); attributes.put(name, location); } }
private void fetchAttributes() { attributes.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_ATTRIBUTES, params); int numAttributes = params.get(0); for(int i=0; i<numAttributes; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveAttrib(programHandle, i, params, type); int location = GLES20.glGetAttribLocation(programHandle, name); attributes.put(name, location); } }
private void fetchAttributes() { attributes.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_ATTRIBUTES, params); int numAttributes = params.get(0); for(int i=0; i<numAttributes; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveAttrib(programHandle, i, params, type); int location = GLES20.glGetAttribLocation(programHandle, name); attributes.put(name, location); } }
private void fetchAttributes() { attributes.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_ATTRIBUTES, params); int numAttributes = params.get(0); for(int i=0; i<numAttributes; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveAttrib(programHandle, i, params, type); int location = GLES20.glGetAttribLocation(programHandle, name); attributes.put(name, location); } }
private void fetchUniforms() { uniforms.clear(); IntBuffer params = IntBuffer.allocate(1); IntBuffer type = IntBuffer.allocate(1); GLES20.glGetProgramiv(programHandle, GLES20.GL_ACTIVE_UNIFORMS, params); int numUniform = params.get(0); for(int i=0; i<numUniform; i++) { params.compact(); params.put(0, 1); type.clear(); String name = GLES20.glGetActiveUniform(programHandle, i, params, type); int location = GLES20.glGetUniformLocation(programHandle, name); uniforms.put(name, location); } }