using of NVDepthConfigChooser(GLSurfaceView view) with AAConfigChooser(this)

Started by aeroxr1, September 27, 2014, 02:56:12 PM

Previous topic - Next topic

aeroxr1

HI :)
If I want to improve the performance of my application on tegra devices, I have read that I should use  NVDepthConfigChooser(GLSurfaceView view).
But if I now use also AAConfigChooser, can I use both ?

I have done in this way :

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.AttributeSet;
import android.view.MotionEvent;

import com.threed.jpct.util.AAConfigChooser;
import com.threed.jpct.util.NVDepthConfigChooser;

public class MyGLSurfaceView extends GLSurfaceView {

MyGLRenderer renderer;
Context activitycontext;
public MovementHandler gestore= new MovementHandler();
public boolean rendercontinuo=false;  //se true renderizza in continuazione, se false renderizza su richiesta

public MyGLSurfaceView (Context context)
  {
         super(context);
         activitycontext=context; //prendo il context dell'activity
         // Create an OpenGL ES 2.0 context.
        setEGLContextClientVersion(2);
        setEGLConfigChooser(new AAConfigChooser(this));
        setEGLConfigChooser(new NVDepthConfigChooser(this));
        // Set the Renderer for drawing on the GLSurfaceView
        renderer = new MyGLRenderer(activitycontext,gestore);
        setRenderer(renderer);
       
        if(rendercontinuo==false)
        setRenderMode(RENDERMODE_WHEN_DIRTY);
       
    }

public MyGLSurfaceView (Context context, AttributeSet attrs)
{
        super(context, attrs);
        activitycontext=context; //prendo il context dell'activity
        // Create an OpenGL ES 2.0 context.
       setEGLContextClientVersion(2);
       setEGLConfigChooser(new AAConfigChooser(this));
       setEGLConfigChooser(new NVDepthConfigChooser(this));
       // Set the Renderer for drawing on the GLSurfaceView
       renderer = new MyGLRenderer(activitycontext,gestore);
       setRenderer(renderer);
       
       if(rendercontinuo==false)
       setRenderMode(RENDERMODE_WHEN_DIRTY);
     
  }


Is it the right way ?

EgonOlsen

No, you can't. But you actually don't have to. The AAConfigChooser already includes what the NVDepthConfigChooser does.

aeroxr1