use of android.opengl.GLSurfaceView in project platform_frameworks_base by android.
the class GLDepthTestActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mGLSurfaceView = new GLSurfaceView(this);
if (detectOpenGLES20()) {
// Tell the surface view we want to create an OpenGL ES
// 2.0-compatible
// context, and set an OpenGL ES 2.0-compatible renderer.
mGLSurfaceView.setEGLContextClientVersion(2);
mRenderer = new GLES20TriangleRenderer(this);
mGLSurfaceView.setRenderer(mRenderer);
} else {
throw new IllegalStateException("Can't find OGL ES2.0 context");
}
setContentView(mGLSurfaceView);
}
use of android.opengl.GLSurfaceView in project love-android by hagish.
the class LoveAndroid method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String path = kGamePath;
if (Launcher.launchMeGamePath != null) {
path = Launcher.launchMeGamePath;
}
if (vm == null) {
vm = createVM(path);
}
vm.assignActivity(this);
// Create a GLSurfaceView instance and set it
// as the ContentView for this Activity.
renderer = new LoveAndroidRenderer(vm);
mGLView = new GLSurfaceView(this);
mGLView.setRenderer(renderer);
// TODO: setPreserveEGLContextOnPause undefined in android 2.1 for
// GLSurfaceView
// ~ try {
// ~ mGLView.setPreserveEGLContextOnPause(true);
// ~ } catch (IOException e) {
// ~ LoveVM.LoveLog(TAG,"mGLView.setPreserveEGLContextOnPause failed");
// // just a warning, not fatal
// ~ }
setContentView(mGLView);
vm.notifyOnCreateDone();
mUpdateHandler.start();
mouseHandler = new MouseHandler(mGLView, vm);
}
use of android.opengl.GLSurfaceView in project MagicCamera by wuhaoyu1990.
the class CameraActivity method initMagicPreview.
private void initMagicPreview() {
GLSurfaceView glSurfaceView = (GLSurfaceView) findViewById(R.id.glsurfaceview_camera);
FrameLayout.LayoutParams params = new LayoutParams(Constants.mScreenWidth, Constants.mScreenHeight);
glSurfaceView.setLayoutParams(params);
mMagicCameraDisplay = new MagicCameraDisplay(this, glSurfaceView);
}
use of android.opengl.GLSurfaceView in project MagicCamera by wuhaoyu1990.
the class ImageActivity method initMagicPreview.
private void initMagicPreview() {
GLSurfaceView glSurfaceView = (GLSurfaceView) findViewById(R.id.glsurfaceview_image);
mMagicImageDisplay = new MagicImageDisplay(this, glSurfaceView);
Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
photoPickerIntent.setType("image/*");
startActivityForResult(photoPickerIntent, REQUEST_PICK_IMAGE);
}
use of android.opengl.GLSurfaceView in project XobotOS by xamarin.
the class GLDualActivity method onCreate.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
View root = getLayoutInflater().inflate(R.layout.gldual_activity, null);
mGLView = (GLSurfaceView) root.findViewById(R.id.gl1);
mGLView.setEGLConfigChooser(5, 6, 5, 0, 0, 0);
mGLView.setRenderer(new TriangleRenderer());
mGL2View = (GLDualGL2View) root.findViewById(R.id.gl2);
setContentView(root);
}
Aggregations