Search in sources :

Example 21 with GLSurfaceView

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);
}
Also used : GLSurfaceView(android.opengl.GLSurfaceView)

Example 22 with GLSurfaceView

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();
        }
    });
}
Also used : Resources(android.content.res.Resources) GLSurfaceView(android.opengl.GLSurfaceView) View(android.view.View)

Example 23 with GLSurfaceView

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);
}
Also used : GLSurfaceView(android.opengl.GLSurfaceView)

Example 24 with GLSurfaceView

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);
}
Also used : GLSurfaceView(android.opengl.GLSurfaceView)

Aggregations

GLSurfaceView (android.opengl.GLSurfaceView)24 View (android.view.View)7 Resources (android.content.res.Resources)4 IOException (java.io.IOException)3 Bitmap (android.graphics.Bitmap)2 Camera (android.hardware.Camera)2 Parameters (android.hardware.Camera.Parameters)2 Uri (android.net.Uri)2 AbsListView (android.widget.AbsListView)2 SeekBar (android.widget.SeekBar)2 File (java.io.File)2 FileNotFoundException (java.io.FileNotFoundException)2 FileOutputStream (java.io.FileOutputStream)2 ActivityManager (android.app.ActivityManager)1 Intent (android.content.Intent)1 ConfigurationInfo (android.content.pm.ConfigurationInfo)1 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)1 Renderer (android.opengl.GLSurfaceView.Renderer)1 DisplayMetrics (android.util.DisplayMetrics)1 FrameLayout (android.widget.FrameLayout)1