1. new一个GLSurfaceView()
2. setRenderer(自定义renderer)
3. setContentView(GLSurfaceView对象)
4. 自定义的renderer要implements GLSurfaceView.Renderer接口.
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//full screen
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
GLSurfaceView glSurfaceView=new GLSurfaceView(this);
glSurfaceView.setRenderer(new OpenGLESRenderer());
setContentView(glSurfaceView);
}
}
public class OpenGLESRender implements Renderer{
@Override
public void onSurfaceCreated(GL10 gl,EGLConfig config){
}
@Override
public void onDrawFrame(GL10 gl){
}
@Override
public void onSurfaceChanged(GL10 gl,int width,int height){
}
}
阅读(1528) | 评论(0) | 转发(0) |