mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Android EGL: Add logging of depth and stencil bits
This commit is contained in:
parent
51fec7f43d
commit
c8f86def97
1 changed files with 22 additions and 1 deletions
|
@ -2,7 +2,11 @@ package org.ppsspp.ppsspp;
|
|||
|
||||
import android.opengl.GLSurfaceView;
|
||||
import android.util.Log;
|
||||
|
||||
import javax.microedition.khronos.egl.EGL10;
|
||||
import javax.microedition.khronos.egl.EGLConfig;
|
||||
import javax.microedition.khronos.egl.EGLContext;
|
||||
import javax.microedition.khronos.egl.EGLDisplay;
|
||||
import javax.microedition.khronos.opengles.GL10;
|
||||
|
||||
public class NativeRenderer implements GLSurfaceView.Renderer {
|
||||
|
@ -24,8 +28,25 @@ public class NativeRenderer implements GLSurfaceView.Renderer {
|
|||
inFrame = false;
|
||||
}
|
||||
|
||||
public void onSurfaceCreated(GL10 unused, EGLConfig config) {
|
||||
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
|
||||
Log.i(TAG, "NativeRenderer: onSurfaceCreated");
|
||||
|
||||
EGL10 egl = (EGL10)EGLContext.getEGL();
|
||||
if (egl != null) {
|
||||
EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
|
||||
if (dpy != null) {
|
||||
int[] val = new int[1];
|
||||
egl.eglGetConfigAttrib(dpy, config, EGL10.EGL_DEPTH_SIZE, val);
|
||||
int depthBits = val[0];
|
||||
egl.eglGetConfigAttrib(dpy, config, EGL10.EGL_STENCIL_SIZE, val);
|
||||
int stencilBits = val[0];
|
||||
Log.i(TAG, "EGL reports " + depthBits + " bits of depth and " + stencilBits + " bits of stencil.");
|
||||
} else {
|
||||
Log.e(TAG, "dpy == null");
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "egl == null");
|
||||
}
|
||||
// Log.i(TAG, "onSurfaceCreated - EGL context is new or was lost");
|
||||
// Actually, it seems that it is here we should recreate lost GL objects.
|
||||
displayInit();
|
||||
|
|
Loading…
Add table
Reference in a new issue