From: Sven G. <sgo...@ja...> - 2001-02-08 05:09:30
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 11 January 2001 12:49, you wrote: > Hello, > > Im trying to find a random bug on tesselation. > well, I just have added a bugfix for the GLU Callback code into the CVS repository. I have announced this to the gl4java-developer mailinglist. This bugfix will appear in version 2.5.1 ! > I read the GLUFunc documentation but I still have > questions. I also read the 3 demos (which runs well) > of the GL4 package. > fine > What is the meaning of parameter signature ? > If my callback method name is myVertexCallBack (for a GLU_TESS_VERTEX > callback), > what is the value of the signature parameter ? e.g. (tessdemo.java line 337): glu.gluTessCallback ( tobj, GLU_TESS_VERTEX, gl, "glVertex2fv", "([F)V", 2, 0, 0, 0, 0); The signature "([F)V" is the original java style signature of the argument-list, your callback method takes (here: glVertex2fv) ! Read SUN's Java Documentation for Java-Callback methods: http://java.sun.com/docs/books/tutorial/native1.1/implementing/method.html Here you can find the mapping of function arguments to its corresponding string signature representation ! > > What is the meaning of the 5 parameters: voidArrayLen1, voidArrayLen2, > voidArrayLen3, > voidArrayLen4, voidArrayLen5, and what value do I need to put ? > The maximum number of arrays within the argumentlist of GLU Callback functions is 5 ! So, the arguments voidArrayLen[1-5] stands for the expected size of the arrays, which are passed into and from the callback funtion. E.g. (tessdemo.java): glu.gluTessCallback ( tobj, GLU_TESS_COMBINE, this, "combine_callback", "([D[D[F[F)V", 2, 0, 0, 2, 0); public void combine_callback( double coords[/*3*/], double vertex_data[/*4xn(=0)*/], float weight[/*4*/], float[/*m(=2)*/] data ) { data[0] = (float) coords[0]; data[1] = (float) coords[1]; } You can see, we do use the arrays data and coords with a size of 2 ! You are not allowed to use nonsense sizes, because this can hurt your application with a segementation fault ! (Well the GL4Java Callback function checks the array sizes to OpenGL's maximum, .. but be kind of ..) The OpenGL machine calls GL4Java's callback function, which dispatches the call (incl. data) to your java callback function ! > Thanxs. > sven - -- mailto:sgo...@ja... www : http://www.jausoft.com ; pgp: http://www.jausoft.com/gpg/ voice : +49-521-2399440, +49-170-2115963; fax: +49-521-2399442 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE6ginwHdOA30NoFAARAsOWAJ9PGjh2MMEFYKMFNTWXqqgJMTzOxgCghQZv oCSTCpb3rNKyAN/4ATXLE2g= =gSxf -----END PGP SIGNATURE----- |