Exemplo n.º 1
0
 public void HandleResult(int inCode) {
   if (inCode == resTerminate) {
     // Log.v("VIEW","Terminate Request.");
     mActivity.finish();
     return;
   }
   double wake = NME.getNextWake();
   final MainView me = this;
   if (wake <= 0)
     queueEvent(
         new Runnable() {
           public void run() {
             me.onPoll();
           }
         });
   else {
     final int tid = ++mTimerID;
     Date end = new Date();
     end.setTime(end.getTime() + (int) (wake * 1000));
     mTimer.schedule(
         new java.util.TimerTask() {
           public void run() {
             if (tid == me.mTimerID) me.queuePoll();
           }
         },
         end);
   }
 }
Exemplo n.º 2
0
 public void onSurfaceChanged(GL10 gl, int width, int height) {
   // Log.v("VIEW","onSurfaceChanged " + width +"," + height);
   mMainView.HandleResult(NME.onResize(width, height));
 }
Exemplo n.º 3
0
 public void onDrawFrame(GL10 gl) {
   // Log.v("VIEW","onDrawFrame !");
   mMainView.HandleResult(NME.onRender());
   Sound.checkSoundCompletion();
   // Log.v("VIEW","onDrawFrame DONE!");
 }
Exemplo n.º 4
0
 void onPoll() {
   HandleResult(NME.onPoll());
 }