Code Select
@Override
public void onCreate(Bundle b) {
super.onCreate(b);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
// setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setContentView(R.layout.camera_view);
initCamera();
initWorld();
}
private void initCamera() {
mSurfaceView = (SurfaceView) findViewById(R.id.surfaceView);
mSurfaceHolder = mSurfaceView.getHolder();
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
mSurfaceHolder.addCallback(this);
}
private void initWorld() {
if (master != null) {
copy(master);
}
mGLView = new GLSurfaceView(getApplication());
mGLView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
renderer = new MyRenderer();
mGLView.setRenderer(renderer);
mGLView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
FrameLayout f = (FrameLayout) findViewById(R.id.camera_view_body);
f.addView(mGLView, 1);
}