public static interface GLSurfaceView.Renderer 
 
| android.opengl.GLSurfaceView.Renderer | 
一个通用的渲染器接口。
渲染器负责使OpenGL调用渲染帧。
GLSurfaceView客户端通常创建自己的实现此接口的类,然后调用 setRenderer(GLSurfaceView.Renderer)向 setRenderer(GLSurfaceView.Renderer)注册渲染器。
有关如何使用OpenGL的更多信息,请阅读 OpenGL开发人员指南。
queueEvent(Runnable) convenience method. 
     
    onSurfaceCreated(GL10, EGLConfig) method is a convenient place to do this. 
     
    也可以看看:
公共方法(Public methods) |  
      |
|---|---|
 abstract void  |  
         onDrawFrame(GL10 gl)  调用绘制当前帧。  |  
      
 abstract void  |  
         onSurfaceChanged(GL10 gl, int width, int height)  当表面改变大小时调用。  |  
      
 abstract void  |  
         onSurfaceCreated(GL10 gl, EGLConfig config)  在表面创建或重新创建时调用。  |  
      
void onDrawFrame (GL10 gl)
调用绘制当前帧。
此方法负责绘制当前帧。
此方法的实现通常如下所示:
 void onDrawFrame(GL10 gl) {
     gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
     //... other gl calls to render the scene ...
 }
  
      
     | 参数(Parameters) | |
|---|---|
gl |  
         GL10: the GL interface. Use instanceof to test if the interface supports GL11 or higher interfaces.  |  
       
void onSurfaceChanged (GL10 gl, int width, int height)
当表面改变大小时调用。
在创建曲面后以及每当OpenGL ES曲面大小发生变化时调用。
通常你会在这里设置你的视口。 如果你的相机是固定的,那么你也可以在这里设置你的投影矩阵:
 void onSurfaceChanged(GL10 gl, int width, int height) {
     gl.glViewport(0, 0, width, height);
     // for a fixed camera, set the projection too
     float ratio = (float) width / height;
     gl.glMatrixMode(GL10.GL_PROJECTION);
     gl.glLoadIdentity();
     gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10);
 }
  
      
     | 参数(Parameters) | |
|---|---|
gl |  
         GL10: the GL interface. Use instanceof to test if the interface supports GL11 or higher interfaces. |  
       
void onSurfaceCreated (GL10 gl, EGLConfig config)
在表面创建或重新创建时调用。
当渲染线程启动并且每当EGL上下文丢失时调用。 当Android设备在睡觉后醒来时,EGL上下文通常会丢失。
由于在渲染开始时以及每次EGL上下文丢失时调用此方法,因此此方法是放置代码以创建在渲染开始时需要创建且需要重新创建的资源的便利场所当EGL上下文丢失时。 纹理是您可能想要在此创建的资源的示例。
请注意,当EGL上下文丢失时,与该上下文关联的所有OpenGL资源将自动删除。 您无需调用相应的“glDelete”方法(如glDeleteTextures)手动删除这些丢失的资源。
| 参数(Parameters) | |
|---|---|
gl |  
         GL10: the GL interface. Use instanceof to test if the interface supports GL11 or higher interfaces. |  
       
config |  
         EGLConfig: the EGLConfig of the created surface. Can be used to create matching pbuffers.  |