Author Topic: using of NVDepthConfigChooser(GLSurfaceView view) with AAConfigChooser(this)  (Read 783 times)

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
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 :

Code: [Select]
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 ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
No, you can't. But you actually don't have to. The AAConfigChooser already includes what the NVDepthConfigChooser does.

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
For the placebo effect with my code I felt like it was smooth  :-[  ;D