diff options
Diffstat (limited to 'CNativeCode/OpenGLU_JauJNI12nf_funcs.c')
-rwxr-xr-x | CNativeCode/OpenGLU_JauJNI12nf_funcs.c | 78 |
1 files changed, 36 insertions, 42 deletions
diff --git a/CNativeCode/OpenGLU_JauJNI12nf_funcs.c b/CNativeCode/OpenGLU_JauJNI12nf_funcs.c index 91eff2f..d97b173 100755 --- a/CNativeCode/OpenGLU_JauJNI12nf_funcs.c +++ b/CNativeCode/OpenGLU_JauJNI12nf_funcs.c @@ -4,35 +4,35 @@ */ -/*
- * Leo Chan -- 1995
- *
- * This C file takes care of all the native implementation for the
- * OpenGL utility commands
- * ---------------
- *
- * Sven Goethel
- *
- * September 1997
- */
-
-
-/*--------------------------------------------------------------------------
- * here on in is just regular apple pie C
- */
-
-#include "OpenGL_misc.h"
-
-#include "gl4java_GLUFuncJauJNInf.h"
-
-#include "GLCallbackHelperJNI.h"
-#include "GLUCallbackJNI.h"
-#include "jnitools.h"
-
-/**
- * herein lies the native JAVA methods for the OpenGL functions.
- */
-
+/* + * Leo Chan -- 1995 + * + * This C file takes care of all the native implementation for the + * OpenGL utility commands + * --------------- + * + * Sven Goethel + * + * September 1997 + */ + + +/*-------------------------------------------------------------------------- + * here on in is just regular apple pie C + */ + +#include "OpenGL_misc.h" + +#include "gl4java_GLUFuncJauJNInf.h" + +#include "GLCallbackHelperJNI.h" +#include "GLUCallbackJNI.h" +#include "jnitools.h" + +/** + * herein lies the native JAVA methods for the OpenGL functions. + */ + static const char _glu_n_a_string[] = "GLU-String not avaiable !"; JNIEXPORT jstring JNICALL @@ -68,7 +68,7 @@ Java_gl4java_GLUFuncJauJNInf_gluGetString ( JNIEnv *env, jobject obj, } static const char * _glu_lib_vendor_="Jausoft - Sven Goethel Software Development"; -static const char * _glu_lib_version_="2.7.1.0"; +static const char * _glu_lib_version_="2.8.0.0"; JNIEXPORT jstring JNICALL Java_gl4java_GLUFuncJauJNInf_getNativeVendor ( JNIEnv *env, jobject obj ) @@ -301,7 +301,7 @@ Java_gl4java_GLUFuncJauJNInf_gluNewTess( JNIEnv *env, jobject obj) } /** - * C2J Parser Version 2.1 + * C2J Parser Version 2.2 * Jausoft - Sven Goethel Software Development * Reading from file: glu-proto-auto.orig.h . . . * Destination-Class: gl4java_GLUFuncJauJNInf ! @@ -638,7 +638,7 @@ Java_gl4java_GLUFuncJauJNInf_gluNewTess( JNIEnv *env, jobject obj) jint widthin, jint heightin, jint typein, - jbyteArray datain, + jstring datain, jint widthout, jint heightout, jint typeout, @@ -646,16 +646,13 @@ Java_gl4java_GLUFuncJauJNInf_gluNewTess( JNIEnv *env, jobject obj) { jint ret; - jbyte *ptr4 = NULL; + char *ptr4 = NULL; jboolean isCopiedArray8 = JNI_FALSE; jbyte *ptr8 = NULL; if ( disp__gluScaleImage == NULL ) return 0; - if(datain!=NULL) - { - ptr4 = (jbyte *) (*env)->GetPrimitiveArrayCritical(env, datain, 0); - } + ptr4 = jnitoolsGetJavaString(env, datain); if(dataout!=NULL) { ptr8 = (jbyte *) (*env)->GetPrimitiveArrayCritical(env, dataout, &isCopiedArray8); @@ -672,10 +669,7 @@ Java_gl4java_GLUFuncJauJNInf_gluNewTess( JNIEnv *env, jobject obj) (char *) ptr8 ); - if(datain!=NULL) - { - (*env)->ReleasePrimitiveArrayCritical(env, datain, ptr4, JNI_ABORT); - } + free(ptr4); if(dataout!=NULL) { (*env)->ReleasePrimitiveArrayCritical(env, dataout, ptr8, (isCopiedArray8 == JNI_TRUE)?0:JNI_ABORT); @@ -2450,4 +2444,4 @@ Java_gl4java_GLUFuncJauJNInf_gluNewTess( JNIEnv *env, jobject obj) } -/* C2J Parser Version 2.1: Java program parsed successfully. */ +/* C2J Parser Version 2.2: Java program parsed successfully. */ |