FileDocCategorySizeDatePackage
SceneGraphView.javaAPI DocAndroid 5.1 API2749Thu Mar 12 22:22:44 GMT 2015com.android.modelviewer

SceneGraphView

public class SceneGraphView extends android.renderscript.RSSurfaceView

Fields Summary
private android.renderscript.RenderScriptGL
mRS
private SceneGraphRS
mRender
Constructors Summary
public SceneGraphView(android.content.Context context)

        super(context);
        //setFocusable(true);
    
Methods Summary
protected voidonDetachedFromWindow()

        if (mRS != null) {
            mRS = null;
            destroyRenderScriptGL();
        }
    
public booleanonKeyDown(int keyCode, android.view.KeyEvent event)

        // break point at here
        // this method doesn't work when 'extends View' include 'extends ScrollView'.
        return super.onKeyDown(keyCode, event);
    
public booleanonTouchEvent(android.view.MotionEvent ev)

        boolean ret = true;
        int act = ev.getAction();
        if (act == ev.ACTION_UP) {
            ret = false;
        }

        mRender.touchEvent((int)ev.getX(), (int)ev.getY());
        return ret;
    
public voidsurfaceChanged(android.view.SurfaceHolder holder, int format, int w, int h)

        super.surfaceChanged(holder, format, w, h);
        if (mRS == null) {
            RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
            sc.setDepth(16, 24);
            mRS = createRenderScriptGL(sc);
            mRS.setSurface(holder, w, h);
            mRender = new SceneGraphRS();
            mRender.init(mRS, getResources(), w, h);
        }