From: Combe, C. <C....@na...> - 2002-06-13 13:07:50
|
thanks Max, i'd have replied sooner but have been away for a few days. Things are working now. I think there was some sort of problem with adding and removing the GLCanvas components from a Panel or Frame, just treating them like i would any other component didn't work anyway. After re-adding them nothing would appear in them. In my efforts to make it work I just ended up over complicating things - this was how i got into destroying and creating new instances and using cvsDispose. Anyway, I now add all the canvas's i'm going to use to the panel at the start and set them visible or invisible as required. It confuses layout managers a bit but i can live with that. cheers, colin -----Original Message----- From: Max Gilead [mailto:gi...@li...] Sent: 07 June 2002 16:59 To: gl4...@li... Subject: Re: [gl4java-usergroup] what is the recommended way of swapping one canvas for another? Combe, Colin wrote: >What is the recommended way of swapping one canvas for another? I'll be most >grateful for any advice. I'd really like to use gl4java for this project and >the actual drawing of the scene works fine and is fast - its just this >canvas changing thing that is the problem. :-( > Is there any reason you have to destroy the canvas each time? It is very inefficient as initialization takes time each time you create a canvas. If I were you I would keep two instances of GL canvas, one on screen and one in inactive state. If the canvas is invisible (ie. removed from the GUI) it won't do anything and you can safely keep it in memory, re-adding to the GUI later and it will draw perfectly well. cvsDispose call is required when you dump the canvas completely and want it to be GC'd. HTH, Max _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ gl4java-usergroup mailing list gl4...@li... https://lists.sourceforge.net/lists/listinfo/gl4java-usergroup |