35 #include <android/log.h>
40 using namespace MaliSDK;
46 typedef const char*(*decodeToken)(EGLint);
74 {EGL_CONFIG_ID,
" EGL_CONFIG_ID %d\n", NULL},
75 {EGL_CONFIG_CAVEAT,
" Config caveat: %s ",
decodeCaveat},
77 {EGL_BUFFER_SIZE,
" Colour depth: %d", NULL},
78 {EGL_RED_SIZE,
" Red %d ", NULL},
79 {EGL_GREEN_SIZE,
" Green %d ", NULL},
80 {EGL_BLUE_SIZE,
" Blue %d ", NULL},
81 {EGL_ALPHA_SIZE,
" Alpha %d\n", NULL},
82 {EGL_DEPTH_SIZE,
" Z-buffer bits: %d\n", NULL},
83 {EGL_SAMPLES,
" %dx anti-aliasing\n", NULL},
86 {EGL_NONE, NULL, NULL}
99 EGLint allAttributes = 0;
101 LOGI(
"Config number %d in returned configs\n", configIndex);
104 while((attribute =
queryList[allAttributes].attribute) != EGL_NONE)
107 EGLBoolean result = eglGetConfigAttrib(display, configs[configIndex], attribute, &value);
109 if(result == EGL_FALSE)
111 LOGE(
"eglGetConfigAttrib failed (%d, %d)\n", configIndex, allAttributes);
142 "Window+Pixmap+PBuffer"
159 case EGL_SLOW_CONFIG:
162 case EGL_NON_CONFORMANT_CONFIG:
163 return "Non-conformant";
166 return "Unknown EGL_CONFIG_CAVEAT";
177 return "RGB colour buffer";
179 case EGL_LUMINANCE_BUFFER:
180 return "Luminance buffer";
183 return "Unknown EGL_COLOR_BUFFER_TYPE";
195 "OpenGL ES, OpenGL ES 2.0",
196 "OpenGL ES 2.0, OpenVG",
197 "OpenGL ES, OpenGL ES 2.0, OpenVG"
211 EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
212 if(display == EGL_NO_DISPLAY)
214 LOGD(
"eglGetDisplay returned EGL_NO_DISPLAY\n");
219 success = eglInitialize(display, &major, &minor);
220 if(success == EGL_FALSE)
222 LOGD(
"eglInitialize failed\n");
226 const char *vendor = eglQueryString(display, EGL_VENDOR);
229 LOGD(
"eglQueryString failed\n");
233 LOGI(
"EGL_VENDOR = %s, version %d.%d\n", vendor, major, minor);
249 EGLint numberOfConfigs;
250 success = eglGetConfigs(display, NULL, 0, &numberOfConfigs);
251 EGLConfig *configs = (EGLConfig*)malloc(
sizeof(EGLConfig)*numberOfConfigs);
252 success &= eglGetConfigs(display, configs, numberOfConfigs, &numberOfConfigs);
253 if(success == EGL_FALSE)
255 LOGD(
"eglGetConfigs failed\n");
260 for(
int allConfigs = 0; allConfigs < numberOfConfigs; allConfigs++)
270 eglTerminate(display);
284 (JNIEnv *env, jclass jcls)
const char *(* decodeToken)(EGLint)
const char * decodeCaveat(EGLint value)
GLint GLsizei GLsizei height
const char * decodeAPISupport(EGLint value)
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_listeglconfigs_ListEGLConfigs_init(JNIEnv *env, jclass jcls, jint width, jint height)
const char * decodeAPISupportStrings[]
const char * decodeColorBuffer(EGLint value)
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_listeglconfigs_ListEGLConfigs_uninit(JNIEnv *, jclass)
const char * decodeSurfaceStrings[]
const char * decodeSurface(EGLint value)
void describeConfig(EGLDisplay display, EGLConfig *configs, int configIndex)
JNIEXPORT void JNICALL Java_com_arm_malideveloper_openglessdk_listeglconfigs_ListEGLConfigs_step(JNIEnv *env, jclass jcls)