Android examples for android.opengl:OpenGL Buffer
upload Buffer to OpenGL
//package com.book2s; import java.nio.Buffer; import android.opengl.GLES20; public class Main { public static int upload(Buffer bufferToUpload, int iTarget, int iBytesPerElement, int iUsage) { int buff[] = new int[1]; GLES20.glGenBuffers(1, buff, 0); int handle = buff[0]; GLES20.glBindBuffer(iTarget, handle); GLES20.glBufferData(iTarget, bufferToUpload.limit() * iBytesPerElement, bufferToUpload, iUsage); GLES20.glBindBuffer(iTarget, 0); return handle; }// www . java 2 s. co m }