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,18 +69,18 @@
     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) {
+    (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 clazz, jlong eglDisplay, jintArray majorArray,
+    (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,21 +90,21 @@
         return JNI_TRUE;
     }
 }
 
 JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglBindAPI
-    (JNIEnv *env, jclass clazz, jint api) {
+    (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 clazz, jlong eglDisplay, jintArray attribs,
+    (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,31 +137,31 @@
     free(longConfigArray);
     return retval;
 }
 
 JNIEXPORT jlong JNICALL Java_com_sun_glass_ui_monocle_EGL__1eglCreateWindowSurface
-    (JNIEnv *env, jclass clazz, jlong eglDisplay, jlong config,
+    (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),
-                                               asPtr(nativeWindow),
-                                               NULL);
+                                         (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 *env, jclass clazz, jlong eglDisplay, jlong config,
-      jlong shareContext, jintArray attribs){
+    (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,11 +174,11 @@
         return asJLong(context);
     }
 }
 
 JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglMakeCurrent
-   (JNIEnv *env, jclass clazz, jlong eglDisplay, jlong drawSurface,
+   (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,11 +186,11 @@
         return JNI_FALSE;
     }
 }
 
 JNIEXPORT jboolean JNICALL Java_com_sun_glass_ui_monocle_EGL_eglSwapBuffers
-    (JNIEnv *env, jclass clazz, jlong eglDisplay, jlong eglSurface) {
+    (JNIEnv *UNUSED(env), jclass UNUSED(clazz), jlong eglDisplay, jlong eglSurface) {
     if (eglSwapBuffers(asPtr(eglDisplay), asPtr(eglSurface))) {
         return JNI_TRUE;
     } else {
         return JNI_FALSE;
     }