public synchronized void threadExiting(GLThread thread) {
   if (LOG_THREADS) {
     Log.i("GLThread", "exiting tid=" + thread.getId());
   }
   thread.mDone = true;
   if (mEglOwner == thread) {
     mEglOwner = null;
   }
   notifyAll();
 }
 public void setRenderer(GLSurfaceView.Renderer renderer) {
   checkRenderThreadState();
   if (mEGLConfigChooser == null) {
     mEGLConfigChooser =
         new BaseConfigChooser.SimpleEGLConfigChooser(true, mEGLContextClientVersion);
   }
   if (mEGLContextFactory == null) {
     mEGLContextFactory = new DefaultContextFactory(mEGLContextClientVersion);
   }
   if (mEGLWindowSurfaceFactory == null) {
     mEGLWindowSurfaceFactory = new DefaultWindowSurfaceFactory();
   }
   mGLThread =
       new GLThread(
           renderer,
           mEGLConfigChooser,
           mEGLContextFactory,
           mEGLWindowSurfaceFactory,
           mGLWrapper);
   mGLThread.start();
 }
 @Override
 public void onSurfaceCreated(SurfaceHolder holder) {
   Log.d(TAG, "onSurfaceCreated()");
   mGLThread.surfaceCreated(holder);
   super.onSurfaceCreated(holder);
 }
 @Override
 public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height) {
   // Log.d(TAG, "onSurfaceChanged()");
   mGLThread.onWindowResize(width, height);
   super.onSurfaceChanged(holder, format, width, height);
 }
 @Override
 public void onDestroy() {
   super.onDestroy();
   // Log.d(TAG, "GLEngine.onDestroy()");
   mGLThread.requestExitAndWait();
 }
 public void queueEvent(Runnable r) {
   mGLThread.queueEvent(r);
 }
 public void onResume() {
   mGLThread.onResume();
 }
 public void onPause() {
   mGLThread.onPause();
 }
 public void requestRender() {
   mGLThread.requestRender();
 }
Exemplo n.º 10
0
 public int getRenderMode() {
   return mGLThread.getRenderMode();
 }
Exemplo n.º 11
0
 public void setRenderMode(int renderMode) {
   mGLThread.setRenderMode(renderMode);
 }