1 package com.android.gallery3d.glrenderer; 2 3 import android.opengl.GLES20; 4 5 import javax.microedition.khronos.opengles.GL11; 6 import javax.microedition.khronos.opengles.GL11ExtensionPack; 7 8 public class GLES20IdImpl implements GLId { 9 private final int[] mTempIntArray = new int[1]; 10 11 @Override generateTexture()12 public int generateTexture() { 13 GLES20.glGenTextures(1, mTempIntArray, 0); 14 GLES20Canvas.checkError(); 15 return mTempIntArray[0]; 16 } 17 18 @Override glGenBuffers(int n, int[] buffers, int offset)19 public void glGenBuffers(int n, int[] buffers, int offset) { 20 GLES20.glGenBuffers(n, buffers, offset); 21 GLES20Canvas.checkError(); 22 } 23 24 @Override glDeleteTextures(GL11 gl, int n, int[] textures, int offset)25 public void glDeleteTextures(GL11 gl, int n, int[] textures, int offset) { 26 GLES20.glDeleteTextures(n, textures, offset); 27 GLES20Canvas.checkError(); 28 } 29 30 31 @Override glDeleteBuffers(GL11 gl, int n, int[] buffers, int offset)32 public void glDeleteBuffers(GL11 gl, int n, int[] buffers, int offset) { 33 GLES20.glDeleteBuffers(n, buffers, offset); 34 GLES20Canvas.checkError(); 35 } 36 37 @Override glDeleteFramebuffers(GL11ExtensionPack gl11ep, int n, int[] buffers, int offset)38 public void glDeleteFramebuffers(GL11ExtensionPack gl11ep, int n, int[] buffers, int offset) { 39 GLES20.glDeleteFramebuffers(n, buffers, offset); 40 GLES20Canvas.checkError(); 41 } 42 } 43