From: Sven G. <sgo...@ja...> - 2002-04-25 02:57:19
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 proposal: NIO V (for all) Arrays via C2J .. =================================== i would like to add NIO Buffer usage for all kind of arrays (for the 1.4 libs only, of course ;-) e.g. (just added them to the manual glu part): - -------------------------- /** * Original Function-Prototype : * <pre> extern void gluTessVertex ( GLUtesselator * tess , GLdouble * location , GLvoid * data ) ; * </pre> */ public final native void gluTessVertex ( long tess, DoubleBuffer location, Buffer data) ; - -------------------------- we force usage of the DoubleBuffer type, so the user MUST create a DoubleBuffer of a ByteBuffer via a view ! a bit more type clean .. - -------------------------- JNIEXPORT void JNICALL Java_gl4java_GLUFunc14JauJNI_gluTessVertex__JLjava_nio_DoubleBuffer_2Ljava_nio_Buffer_2 ( JNIEnv *env, jobject obj, jlong tess, jobject location, jobject data) { jboolean isCopiedArray1 = JNI_FALSE; jdouble *ptr1 = NULL; void *ptr2 = NULL; if ( disp__gluTessVertex == NULL ) return; if(location!=NULL) { ptr1 = (jdouble *) (*env)->GetDirectBufferAddress(env, location); if (ptr1 == NULL) { (*env)->ThrowNew(env, (*env)->FindClass(env, "java/lang/IllegalArgumentException"), "Argument 1 was not a direct double buffer"); return ; } } .. etc .. - -------------------------- today, only "void *" are wrapped up to any Buffer ! so "tomorrow", we can offer strict type Buffer's for any specific typed array ... please vote ! cheers, sven - -- health & wealth mailto:sgo...@ja... www : http://www.jausoft.com ; pgp: http://www.jausoft.com/gpg/ voice : +49-521-2399440 ; fax : +49-521-2399442 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8x3CAHdOA30NoFAARArp/AJ0f8NVJpeBSbdSsqdO+rNBAjfzl5wCaA4uq rSDg3Sr603LjMtsCB1d80GU= =79fz -----END PGP SIGNATURE----- |