From a5c19f54c33e447acb981bd81cf7e02f9a6768fc Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Tue, 5 Mar 2013 19:03:32 +0000 Subject: [PATCH] Android : Added a FINE log of all the display configurations available on the device when the context starts. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10469 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../system/android/AndroidConfigChooser.java | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/engine/src/android/com/jme3/system/android/AndroidConfigChooser.java b/engine/src/android/com/jme3/system/android/AndroidConfigChooser.java index fc1918b4c..9fffbb914 100644 --- a/engine/src/android/com/jme3/system/android/AndroidConfigChooser.java +++ b/engine/src/android/com/jme3/system/android/AndroidConfigChooser.java @@ -95,7 +95,7 @@ public class AndroidConfigChooser implements EGLConfigChooser { @Override public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) { logger.fine("GLSurfaceView asks for egl config, returning: "); - logEGLConfig(choosenConfig, display, egl); + logEGLConfig(choosenConfig, display, egl, Level.FINE); return choosenConfig; } @@ -115,7 +115,7 @@ public class AndroidConfigChooser implements EGLConfigChooser { if (choosenConfig != null) { logger.info("JME3 using choosen config: "); - logEGLConfig(choosenConfig, display, egl); + logEGLConfig(choosenConfig, display, egl, Level.INFO); pixelFormat = getPixelFormat(choosenConfig, display, egl); clientOpenGLESVersion = getOpenGLVersion(choosenConfig, display, egl); return true; @@ -165,38 +165,38 @@ public class AndroidConfigChooser implements EGLConfigChooser { * @param display * @param egl */ - public void logEGLConfig(EGLConfig conf, EGLDisplay display, EGL10 egl) { + public void logEGLConfig(EGLConfig conf, EGLDisplay display, EGL10 egl, Level level) { int[] value = new int[1]; egl.eglGetConfigAttrib(display, conf, EGL10.EGL_RED_SIZE, value); - logger.info(String.format("EGL_RED_SIZE = %d", value[0])); + logger.log(level,String.format("EGL_RED_SIZE = %d", value[0])); egl.eglGetConfigAttrib(display, conf, EGL10.EGL_GREEN_SIZE, value); - logger.info(String.format("EGL_GREEN_SIZE = %d", value[0])); + logger.log(level,String.format("EGL_GREEN_SIZE = %d", value[0])); egl.eglGetConfigAttrib(display, conf, EGL10.EGL_BLUE_SIZE, value); - logger.info(String.format("EGL_BLUE_SIZE = %d", value[0])); + logger.log(level,String.format("EGL_BLUE_SIZE = %d", value[0])); egl.eglGetConfigAttrib(display, conf, EGL10.EGL_ALPHA_SIZE, value); - logger.info(String.format("EGL_ALPHA_SIZE = %d", value[0])); + logger.log(level,String.format("EGL_ALPHA_SIZE = %d", value[0])); egl.eglGetConfigAttrib(display, conf, EGL10.EGL_DEPTH_SIZE, value); - logger.info(String.format("EGL_DEPTH_SIZE = %d", value[0])); + logger.log(level,String.format("EGL_DEPTH_SIZE = %d", value[0])); egl.eglGetConfigAttrib(display, conf, EGL10.EGL_STENCIL_SIZE, value); - logger.info(String.format("EGL_STENCIL_SIZE = %d", value[0])); + logger.log(level,String.format("EGL_STENCIL_SIZE = %d", value[0])); egl.eglGetConfigAttrib(display, conf, EGL10.EGL_RENDERABLE_TYPE, value); - logger.info(String.format("EGL_RENDERABLE_TYPE = %d", value[0])); + logger.log(level,String.format("EGL_RENDERABLE_TYPE = %d", value[0])); egl.eglGetConfigAttrib(display, conf, EGL10.EGL_SURFACE_TYPE, value); - logger.info(String.format("EGL_SURFACE_TYPE = %d", value[0])); + logger.log(level,String.format("EGL_SURFACE_TYPE = %d", value[0])); egl.eglGetConfigAttrib(display, conf, EGL10.EGL_SAMPLE_BUFFERS, value); - logger.info(String.format("EGL_SAMPLE_BUFFERS = %d", value[0])); + logger.log(level,String.format("EGL_SAMPLE_BUFFERS = %d", value[0])); egl.eglGetConfigAttrib(display, conf, EGL10.EGL_SAMPLES, value); - logger.info(String.format("EGL_SAMPLES = %d", value[0])); + logger.log(level,String.format("EGL_SAMPLES = %d", value[0])); } public int getClientOpenGLESVersion() { @@ -230,10 +230,11 @@ public class AndroidConfigChooser implements EGLConfigChooser { EGLConfig[] configs = new EGLConfig[numConfigs]; egl.eglChooseConfig(display, configSpec, configs, numConfigs, num_config); -// System.err.println("-----------------------------"); -// for (EGLConfig eGLConfig : configs) { -// logEGLConfig(eGLConfig, display, egl); -// } + logger.fine("--------------Display Configurations---------------"); + for (EGLConfig eGLConfig : configs) { + logEGLConfig(eGLConfig, display, egl, Level.FINE); + logger.fine("----------------------------------------"); + } EGLConfig config = chooseConfig(egl, display, configs); return config; @@ -334,7 +335,7 @@ public class AndroidConfigChooser implements EGLConfigChooser { keep = false; } } - + if (keep) { keptConfig = config; }