package com.turboconnard.core;
import android.opengl.GLSurfaceView;
import android.view.Display;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
public class MainView extends GLSurfaceView {
//protected MainThread thread;
protected SurfaceHolder holder;
private MainActivity context;
public MainView(MainActivity pContext/*, AttributeSet attrs*/) {
super(pContext/*,attrs*/);
context = pContext;
holder = getHolder();
holder.addCallback(this);
setFocusable(true);
/* First, get the Display from the WindowManager */
}
@Override
public boolean onTouchEvent(MotionEvent event){
return context.agd.onTouchEvent(event);
}
/*
public MainThread getThread() {
// return thread;
}*/
/*
@Override
public boolean onKeyUp(int keyCode, KeyEvent msg) {
return thread.onKeyUp(keyCode, msg);
}
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
// if (!hasWindowFocus) thread.pause();
}
public void surfaceChanged(SurfaceHolder holder, int format, int width,
int height) {
thread.setSurfaceSize(width, height);
}
*/
/*
@Override
public void surfaceCreated(SurfaceHolder holder) {
}*/
/*
public void surfaceDestroyed(SurfaceHolder holder) {
boolean retry = true;
thread.setRunning(false);
while (retry) {
try {
thread.join();
retry = false;
} catch (InterruptedException e) {
}
}
}*/
}
|