- Moved all gl4es+egl management into gl_bridge.c and gl_bridge.h
- Also, reimplemented it from scratch with surface swapping support
This commit is contained in:
Boulay Mathias 2022-10-03 19:48:54 +02:00
parent 424e6bb630
commit 1261e4a7ea
5 changed files with 246 additions and 53 deletions

View file

@ -143,7 +143,10 @@ public class MinecraftGLSurface extends View {
private boolean isCalled = false;
@Override
public void surfaceCreated(@NonNull SurfaceHolder holder) {
if(isCalled) return;
if(isCalled) {
JREUtils.setupBridgeWindow(surfaceView.getHolder().getSurface());
return;
}
isCalled = true;
realStart(surfaceView.getHolder().getSurface());
@ -168,7 +171,10 @@ public class MinecraftGLSurface extends View {
private boolean isCalled = false;
@Override
public void onSurfaceTextureAvailable(@NonNull SurfaceTexture surface, int width, int height) {
if(isCalled) return;
if(isCalled) {
JREUtils.setupBridgeWindow(new Surface(surface));
return;
}
isCalled = true;
realStart(new Surface(textureView.getSurfaceTexture()));