Пример #1
0
  @Override
  public boolean onTouchEvent(MotionEvent ev) {
    boolean ret = false;
    int act = ev.getAction();
    if (act == ev.ACTION_DOWN) {
      mRender.onActionDown((int) ev.getX(), (int) ev.getY());
      ret = true;
    } else if (act == ev.ACTION_MOVE) {
      mRender.onActionMove((int) ev.getX(), (int) ev.getY());
      ret = true;
    }

    return ret;
  }
Пример #2
0
 @Override
 protected void onDetachedFromWindow() {
   if (mRS != null) {
     mRender.cleanup();
     mRS = null;
     destroyRenderScriptGL();
   }
 }
Пример #3
0
 public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
   super.surfaceChanged(holder, format, w, h);
   if (mRS == null) {
     RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
     mRS = createRenderScriptGL(sc);
     mRS.setSurface(holder, w, h);
     mRender = new RSTestCore(mCtx);
     mRender.init(mRS, getResources(), w, h);
   }
 }