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); } }
public void onSurfaceChanged(GL10 gl, int width, int height) { // Log.v("VIEW","onSurfaceChanged " + width +"," + height); mMainView.HandleResult(NME.onResize(width, height)); }
public void onDrawFrame(GL10 gl) { // Log.v("VIEW","onDrawFrame !"); mMainView.HandleResult(NME.onRender()); Sound.checkSoundCompletion(); // Log.v("VIEW","onDrawFrame DONE!"); }
void onPoll() { HandleResult(NME.onPoll()); }