From: Sven G. <sgo...@ja...> - 2000-09-08 10:09:39
|
Jean-Yves BRUD wrote: > > Hello Olivier, > > I also got some crash problem with tesselation. Particularly with > ERROR and COMBINE callbacks. > Ok - let's fix it now ! Because I am a very lazy guy :-), please send the complete code (a running class with main) in a zip archive ! Please note, that the demos: tess.java, tessdemo.java & tesswind.java does run - at least under unix and win32+sun-jvm ! Please also note, that there may be some problems with the MS-JVM & some MS-OpenGL implementations :-( Please add info's about your os, jvm (vendor+version), OpenGL vendor+version ! THANXS ! > I noticed usually, the reason was the callback declaration format and > function signature parameters. I also tried several combination. > You may try the following: > > // Call back declaration > // ------------------------ > > /*gluFunc.gluTessCallback( tesselator, gluFunc.GLU_TESS_ERROR, > this, "errorCallback", "(I)V", 0, 0, 0, 0, 0); >> CRASH*/ > public void errorCallback(int errorCode) > { > throw(new Exception("....")); > } > THIS error implementation is NOT OK !!!! You should not throw an exception ... ! Please note, that the callback java methods are called out of the opengl machine !! The java callback's should be as short as possible. An exceptions wants to unwind the java stack to find a catch block, or to leave the thread/process ! This may break the opengl machine ! Just do some printout, flag change or something else (see tess.java) ! Yours, Sven > I fact, the gl4java implementation for tesselation is not very clear > to me. > Well, let's do a Q&A session ! Then we may can generate a little HOWTO ! I thought, the little demos are clear :-( > Last minute remark about your code: > In your END call back declaration, you put a "glBegin" String! Are you > it is what you want ? > glu.gluTessCallback(tesselator,GLU_TESS_END,gl,"glBegin","()V",0,0,0,0,0); > :-) See above - add a good archive + os+jvm+opengl info's to follow your problem ... > Bye. > Peace, 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 |