use of android.opengl.GLSurfaceView in project GLtext by yulu.
the class GLActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
requestWindowFeature(Window.FEATURE_NO_TITLE);
mView = new GLSurfaceView(this);
mView.setEGLContextClientVersion(2);
mView.setRenderer(new GLLayer(this));
setContentView(mView);
}
use of android.opengl.GLSurfaceView in project android_frameworks_base by ResurrectionRemix.
the class DemoPresentation method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
// Be sure to call the super class.
super.onCreate(savedInstanceState);
// Get the resources for the context of the presentation.
// Notice that we are getting the resources from the context of the presentation.
Resources r = getContext().getResources();
// Inflate the layout.
setContentView(R.layout.presentation_content);
// Set up the surface view for visual interest.
mRenderer = new CubeRenderer(false);
mSurfaceView = (GLSurfaceView) findViewById(R.id.surface_view);
mSurfaceView.setRenderer(mRenderer);
// Add a button.
mExplodeButton = (Button) findViewById(R.id.explode_button);
mExplodeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mRenderer.explode();
}
});
}
use of android.opengl.GLSurfaceView in project android_frameworks_base by ResurrectionRemix.
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 android_frameworks_base by crdroidandroid.
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);
}
Aggregations