Android OpenGL实战 开发框架搭建、三角形和四边形的绘制
2010-05-14 16:51:00 来源:WEB开发网package com.zjc.test;
import android.app.Activity;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.main);
GLReader reader=new GLReader();
GLSurfaceView glview=new GLSurfaceView(this);
glview.setRenderer(reader);
setContentView(glview);
}
}
package
com.zjc.test;
import android.app.Activity;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.main);
GLReader reader=new GLReader();
GLSurfaceView glview=new GLSurfaceView(this);
glview.setRenderer(reader);
setContentView(glview);
}
}
没什么好说的,基本上都是固定的,要记得 setContentView(R.layout.main)是无效的!
<>更多精彩
赞助商链接