modules/graphics/src/main/native-glass/monocle/EGL.c

Print this page
rev 6856 : RT-36822 [Monocle] X11 framebuffer container doesn't work any more

*** 69,86 **** eglAttrs[index++] = EGL_OPENGL_ES2_BIT; eglAttrs[index] = EGL_NONE; } JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_monocle_EGL_eglGetDisplay ! (JNIEnv *env, jclass clazz, jlong display) { // EGLNativeDisplayType is defined differently on different systems; can be an int or a ptr so cast with care EGLDisplay dpy = eglGetDisplay(((EGLNativeDisplayType) (unsigned long)(display))); return asJLong(dpy); } JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglInitialize ! (JNIEnv *env, jclass clazz, jlong eglDisplay, jintArray majorArray, jintArray minorArray){ EGLint major, minor; if (!eglInitialize(asPtr(eglDisplay), &major, &minor)) { (*env)->SetIntArrayRegion(env, majorArray, 0, 1, &major); --- 69,86 ---- eglAttrs[index++] = EGL_OPENGL_ES2_BIT; eglAttrs[index] = EGL_NONE; } JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_monocle_EGL_eglGetDisplay ! (JNIEnv *UNUSED(env), jclass UNUSED(clazz), jlong display) { // EGLNativeDisplayType is defined differently on different systems; can be an int or a ptr so cast with care EGLDisplay dpy = eglGetDisplay(((EGLNativeDisplayType) (unsigned long)(display))); return asJLong(dpy); } JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglInitialize ! (JNIEnv *env, jclass UNUSED(clazz), jlong eglDisplay, jintArray majorArray, jintArray minorArray){ EGLint major, minor; if (!eglInitialize(asPtr(eglDisplay), &major, &minor)) { (*env)->SetIntArrayRegion(env, majorArray, 0, 1, &major);
*** 90,110 **** return JNI_TRUE; } } JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglBindAPI ! (JNIEnv *env, jclass clazz, jint api) { if (eglBindAPI(api)) { return JNI_TRUE; } else { return JNI_FALSE; } } JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglChooseConfig ! (JNIEnv *env, jclass clazz, jlong eglDisplay, jintArray attribs, jlongArray configs, jint configSize, jintArray numConfigs) { int i=0; int eglAttrs[50]; /* value, attr pair plus a None */ --- 90,110 ---- return JNI_TRUE; } } JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglBindAPI ! (JNIEnv *UNUSED(env), jclass UNUSED(clazz), jint api) { if (eglBindAPI(api)) { return JNI_TRUE; } else { return JNI_FALSE; } } JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglChooseConfig ! (JNIEnv *env, jclass UNUSED(clazz), jlong eglDisplay, jintArray attribs, jlongArray configs, jint configSize, jintArray numConfigs) { int i=0; int eglAttrs[50]; /* value, attr pair plus a None */
*** 137,167 **** free(longConfigArray); return retval; } JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_monocle_EGL__1eglCreateWindowSurface ! (JNIEnv *env, jclass clazz, jlong eglDisplay, jlong config, jlong nativeWindow, jintArray attribs) { EGLSurface eglSurface; EGLint *attrArray = NULL; if (attribs != NULL) attrArray = (*env)->GetIntArrayElements(env, attribs, JNI_FALSE); eglSurface = eglCreateWindowSurface(asPtr(eglDisplay), asPtr(config), ! asPtr(nativeWindow), ! NULL); if (attrArray != NULL) { (*env)->ReleaseIntArrayElements(env, attribs, attrArray, JNI_ABORT); } return asJLong(eglSurface); } JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_monocle_EGL_eglCreateContext ! (JNIEnv *env, jclass clazz, jlong eglDisplay, jlong config, ! jlong shareContext, jintArray attribs){ // we don't support any passed-in context attributes presently // we don't support any share context presently EGLint contextAttrs[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE}; EGLContext context = eglCreateContext(asPtr(eglDisplay), asPtr(config), --- 137,167 ---- free(longConfigArray); return retval; } JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_monocle_EGL__1eglCreateWindowSurface ! (JNIEnv *UNUSED(env), jclass UNUSED(clazz), jlong eglDisplay, jlong config, jlong nativeWindow, jintArray attribs) { EGLSurface eglSurface; EGLint *attrArray = NULL; if (attribs != NULL) attrArray = (*env)->GetIntArrayElements(env, attribs, JNI_FALSE); eglSurface = eglCreateWindowSurface(asPtr(eglDisplay), asPtr(config), ! (EGLNativeWindowType) asPtr(nativeWindow), ! (EGLint *) NULL); if (attrArray != NULL) { (*env)->ReleaseIntArrayElements(env, attribs, attrArray, JNI_ABORT); } return asJLong(eglSurface); } JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_monocle_EGL_eglCreateContext ! (JNIEnv *UNUSED(env), jclass UNUSED(clazz), jlong eglDisplay, jlong config, ! jlong UNUSED(shareContext), jintArray UNUSED(attribs)){ // we don't support any passed-in context attributes presently // we don't support any share context presently EGLint contextAttrs[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE}; EGLContext context = eglCreateContext(asPtr(eglDisplay), asPtr(config),
*** 174,184 **** return asJLong(context); } } JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglMakeCurrent ! (JNIEnv *env, jclass clazz, jlong eglDisplay, jlong drawSurface, jlong readSurface, jlong eglContext) { if (eglMakeCurrent(asPtr(eglDisplay), asPtr(drawSurface), asPtr(readSurface), asPtr(eglContext))) { return JNI_TRUE; --- 174,184 ---- return asJLong(context); } } JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglMakeCurrent ! (JNIEnv *UNUSED(env), jclass UNUSED(clazz), jlong eglDisplay, jlong drawSurface, jlong readSurface, jlong eglContext) { if (eglMakeCurrent(asPtr(eglDisplay), asPtr(drawSurface), asPtr(readSurface), asPtr(eglContext))) { return JNI_TRUE;
*** 186,196 **** return JNI_FALSE; } } JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglSwapBuffers ! (JNIEnv *env, jclass clazz, jlong eglDisplay, jlong eglSurface) { if (eglSwapBuffers(asPtr(eglDisplay), asPtr(eglSurface))) { return JNI_TRUE; } else { return JNI_FALSE; } --- 186,196 ---- return JNI_FALSE; } } JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglSwapBuffers ! (JNIEnv *UNUSED(env), jclass UNUSED(clazz), jlong eglDisplay, jlong eglSurface) { if (eglSwapBuffers(asPtr(eglDisplay), asPtr(eglSurface))) { return JNI_TRUE; } else { return JNI_FALSE; }