Code example for GL10

Methods: glClearglColor4fglDrawArraysglLineWidthglVertexPointer

0
       } 
 
       //drawGL 
       public void onDrawFrame(GL10 gl) {
    	   Log.i(glTag, "onDrawFrame()");
           gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
           gl.glColor4f(1,1,0,1);
//           float vert[] = {0, 0.5f, -0.5f, -0.5f, 0.5f, -0.5f }; 
           float vert[] = {point[0], point[1], point[2], point[3], point[4], point[5], point[6], point[7]};
           Log.i("glTag", "points : " + point[0]+","+point[1]+","+point[2]+","+point[3]+","+point[4]+","+point[5]+","+point[6]+","+point[7]);
           ByteBuffer bytebuf = ByteBuffer.allocateDirect(vert.length*4);
           bytebuf.order(ByteOrder.nativeOrder());
           FloatBuffer vertbuf = bytebuf.asFloatBuffer();
           vertbuf.put(vert);
           vertbuf.position(0);
           
           gl.glLineWidth(5);
           gl.glVertexPointer(2, GL10.GL_FLOAT, 0, vertbuf);
           gl.glDrawArrays(GL10.GL_LINE_LOOP, 0, 4);
       } 
  } 
    
   private float[] setGLPoints(float points[]){
	   float glPoints[] = {0,0,0,0,0,0,0,0};
Stop searching for code, let great code find you!  Add Codota to your java IDE