当前位置: 首页>>代码示例>>Java>>正文


Java GLSurfaceView.setEGLConfigChooser方法代码示例

本文整理汇总了Java中android.opengl.GLSurfaceView.setEGLConfigChooser方法的典型用法代码示例。如果您正苦于以下问题:Java GLSurfaceView.setEGLConfigChooser方法的具体用法?Java GLSurfaceView.setEGLConfigChooser怎么用?Java GLSurfaceView.setEGLConfigChooser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.opengl.GLSurfaceView的用法示例。


在下文中一共展示了GLSurfaceView.setEGLConfigChooser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.opengl.GLSurfaceView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    if (!Utils.supportGlEs20(this)) {
        Toast.makeText(this, "GLES 2.0 not supported!", Toast.LENGTH_LONG).show();
        finish();
        return;
    }

    mGLSurfaceView = (GLSurfaceView) findViewById(R.id.surface);

    mGLSurfaceView.setEGLContextClientVersion(2);
    mRenderer = new DemoRenderer(this);
    mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
    mGLSurfaceView.setRenderer(mRenderer);
    mGLSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
}
 
开发者ID:Piasy,项目名称:OpenGLESTutorial-Android,代码行数:20,代码来源:MainActivity.java

示例2: VrShellImpl

import android.opengl.GLSurfaceView; //导入方法依赖的package包/类
@UsedByReflection("VrShellDelegate.java")
public VrShellImpl(Activity activity) {
    super(activity);
    mActivity = activity;
    mContentViewCoreContainer = new FrameLayout(getContext()) {
        @Override
        public boolean dispatchTouchEvent(MotionEvent event) {
            return true;
        }
    };
    addView(mContentViewCoreContainer, 0, new FrameLayout.LayoutParams(
            FrameLayout.LayoutParams.MATCH_PARENT,
            FrameLayout.LayoutParams.MATCH_PARENT));
    mGlSurfaceView = new GLSurfaceView(getContext());
    mGlSurfaceView.setEGLContextClientVersion(2);
    mGlSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 0, 0);
    mGlSurfaceView.setPreserveEGLContextOnPause(true);
    mGlSurfaceView.setRenderer(this);
    setPresentationView(mGlSurfaceView);

    if (setAsyncReprojectionEnabled(true)) {
        AndroidCompat.setSustainedPerformanceMode(mActivity, true);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:25,代码来源:VrShellImpl.java

示例3: onResume

import android.opengl.GLSurfaceView; //导入方法依赖的package包/类
@Override
protected void onResume() {
    super.onResume();
    if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
        Intent intent = new Intent(this, RequestPermissionsActivity.class);
        intent.putExtra(EXTRA_MESSAGE, "Request");
        startActivity(intent);
        // Should we show an explanation?
        /*if (ActivityCompat.shouldShowRequestPermissionRationale( this, Manifest.permission.CAMERA)) {
            // Show an explanation to the user *asynchronously* -- don't block this thread waiting for the user's response! After the user sees the explanation, try again to request the permission.
        }else{
            // No explanation needed, we can request the permission.
            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, MY_PERMISSIONS_REQUEST_CAMERA);
        }*/
    }
    glView = new GLSurfaceView( this );// Now let's create an OpenGL surface.
    glView.setEGLConfigChooser( 8, 8, 8, 8, 16, 0 );
    glView.getHolder().setFormat( PixelFormat.TRANSLUCENT );// To see the camera preview, the OpenGL surface has to be created translucently.
    glView.setRenderer( new GLClearRenderer() );// The renderer will be implemented in a separate class, GLView, which I'll show next.
    setContentView( glView );// Now set this as the main view.
    if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) {
        cameraView = new CameraView(this);// Now also create a view which contains the camera preview...
        addContentView(cameraView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));// ...and add it, wrapping the full screen size.
    }


}
 
开发者ID:GregoireSailland,项目名称:AR,代码行数:28,代码来源:Launcher.java


注:本文中的android.opengl.GLSurfaceView.setEGLConfigChooser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。