GLSurfaceView: call SurfaceHolderCallback.surfaceCreated in case the app expects that; compensate for mismatch between touch input and the rendering area

This commit is contained in:
Mis012
2022-12-27 17:11:09 +01:00
parent 8d4c22e2a3
commit 63d7427d0e
2 changed files with 34 additions and 6 deletions

View File

@@ -15,13 +15,20 @@ import android.view.View;
import android.view.MotionEvent;
public class GLSurfaceView extends View { // TODO: have this extend SurfaceView once that one is implemented?
import android.view.SurfaceHolder;
public class GLSurfaceView extends View implements SurfaceHolder.Callback { // TODO: have this extend SurfaceView once that one is implemented?
EGLContextFactory context_factory = new default_ContextFactory();
EGLConfigChooser config_chooser = new boolean_ConfigChooser(true);
EGL10 java_egl_wrapper;
GL10 java_gl_wrapper;
int opengl_version = 1;
// from SurfaceHolder.Callback
public void surfaceCreated(SurfaceHolder surfaceHolder) {}
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {}
public void surfaceDestroyed(SurfaceHolder holder) {}
public GLSurfaceView(AttributeSet attrs) {
super(attrs);