Search in sources :

Example 1 with GLSurfaceView

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

Example 2 with GLSurfaceView

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

Example 3 with GLSurfaceView

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);
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams) LayoutParams(android.widget.FrameLayout.LayoutParams) FrameLayout(android.widget.FrameLayout) GLSurfaceView(android.opengl.GLSurfaceView) MagicCameraDisplay(com.seu.magicfilter.display.MagicCameraDisplay)

Example 4 with 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);
}
Also used : MagicImageDisplay(com.seu.magicfilter.display.MagicImageDisplay) Intent(android.content.Intent) GLSurfaceView(android.opengl.GLSurfaceView)

Example 5 with GLSurfaceView

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

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