www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: aeroxr1 on September 27, 2014, 02:56:12 pm

Title: using of NVDepthConfigChooser(GLSurfaceView view) with AAConfigChooser(this)
Post by: aeroxr1 on September 27, 2014, 02:56:12 pm
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 ?
Title: Re: using of NVDepthConfigChooser(GLSurfaceView view) with AAConfigChooser(this)
Post by: EgonOlsen on September 27, 2014, 05:14:08 pm
No, you can't. But you actually don't have to. The AAConfigChooser already includes what the NVDepthConfigChooser does.
Title: Re: using of NVDepthConfigChooser(GLSurfaceView view) with AAConfigChooser(this)
Post by: aeroxr1 on September 27, 2014, 07:42:56 pm
For the placebo effect with my code I felt like it was smooth  :-[  ;D