src/api-impl: misc stubbing

This commit is contained in:
Mis012
2023-01-09 12:07:57 +01:00
parent eabfaeaeba
commit 4dd31731f9
7 changed files with 53 additions and 3 deletions

View File

@@ -17,7 +17,11 @@ import android.view.MotionEvent;
import android.view.SurfaceHolder;
public class GLSurfaceView extends View implements SurfaceHolder.Callback { // TODO: have this extend SurfaceView once that one is implemented?
import android.view.Surface;
import android.graphics.Canvas;
import android.graphics.Rect;
public class GLSurfaceView extends View implements SurfaceHolder.Callback { // TODO: have this extend SurfaceView?
EGLContextFactory context_factory = new default_ContextFactory();
EGLConfigChooser config_chooser = new boolean_ConfigChooser(true);
EGL10 java_egl_wrapper;
@@ -146,6 +150,26 @@ public class GLSurfaceView extends View implements SurfaceHolder.Callback { // T
r.run();
}
private class DummySurfaceHolder implements SurfaceHolder {
public void addCallback(Callback callback) {}
public void removeCallback(Callback callback) {}
public boolean isCreating() {return false;}
public void setType(int type) {}
public void setFixedSize(int width, int height) {}
public void setSizeFromLayout() {}
public void setFormat(int format) {}
public void setKeepScreenOn(boolean screenOn) {}
public Canvas lockCanvas() {return null;}
public Canvas lockCanvas(Rect dirty) {return null;}
public void unlockCanvasAndPost(Canvas canvas) {}
public Rect getSurfaceFrame() {return null;}
public Surface getSurface() {return null;}
}
public SurfaceHolder getHolder() {
return (SurfaceHolder) new DummySurfaceHolder();
}
private static class boolean_ConfigChooser implements GLSurfaceView.EGLConfigChooser {
// TODO - what happens if we actually allow for 16 bits per color?
private static int[] config_attribs_no_depth = {EGL10.EGL_RED_SIZE, 8, EGL10.EGL_GREEN_SIZE, 8, EGL10.EGL_BLUE_SIZE, 8, EGL10.EGL_ALPHA_SIZE, 0, EGL10.EGL_DEPTH_SIZE, 0, EGL10.EGL_STENCIL_SIZE, 0, EGL10.EGL_NONE};