PDA

View Full Version : Using WWJ with Docking Framework


krheinwald
06-04-2007, 11:10 AM
I have modified BasicDemo to use VlDocking (http://www.vlsolutions.com/en/index.php), a docking framework proven to support JOGL and heavyweight components. Everything works fine (see Image1) until the window containg WWJ is moved or hidden when the image is lost and only grey outlines remain (See Image2).

Lilian, authour of VlDocking with a lot of JOGL background suggests: 'Must be texture objects that aren't bound again when changing of top container (as the opengl context changes, previous texture objects and display list are lost in the process).'

Any suggestions on how to fix this or should i create an issue?

Klaus

fabrizio.giudici
06-04-2007, 11:21 AM
I was about to post a similar issue. I'm not using VlDocking, nevertheless in my app I remove the WWJ window from its component (to replace it with another component), and the second time I select WWJ all textures are lost.

krheinwald
06-04-2007, 01:25 PM
That seems to be the same problem. This is what Lilian wrote further down in his mail:

'You should be able to demo the problem without VLDocking : Just install you WW canvas inside a Frame, and then move it into another frame (on a button event for example). If you loose your texture info, than it's a WW bug you'll have to report to the developers.'

tag
06-07-2007, 04:39 PM
Looks like a new GL context is being used when you make whatever change you're making. WWJ does not attempt to detect replacement of the underlying GLCanvas. (And I'm doubting that it should.) Is that what's happening in response to the move/hide? Does the docking code take responsibility for cloning the context state when it creates a new one? If so, does it attempt to use JOGL's context sharing? If it does the latter, then I'd expect the textures to remain bound to their previous object ids. But we're still experimenting/learning about context sharing.

Lilian
06-24-2007, 08:58 AM
Hello, I'm the author of VLDocking and also a JOGL contributor (JOGLAppletLauncher)

I haven't been able yet to have a look at WWJ sdk, but I hope doing so in the near future.

There's a rather common case you seem to be hitting here, which is the same as when swapping between windowed and full screen mode : GLContext is lost by ancestor peer change.

Usually this problem is resolved with a proper reentrant init(GLAutoDrawable) method, that recreates texture objects and display lists, or clears the cache where these things are stored.

The bug reported here has nothing to do with VLDocking : I just move an AWT container (parent of GLCanvas) to another container.

Hope it helps !

Lilian Chamontin

pred
06-24-2007, 04:15 PM
The solution : WorldWind.getMemoryCache().clear(); before and/or after an action which can compromise your GLCanvas Panel.

schwaller
10-12-2010, 04:34 PM
Hello WW Team

I'm still loosing the SurfaceImages after i maximize the InfoNode Panel which contains the WW Canvas (AWT). I'm working on OSX if that might have something to do with it? After getting paranoid i added a listener which responds to hierachy changes. Everytime i loose the parent i make a new Layer, add it to the layerlist, create new SurfaceImages, add them to the new layer and use the clear cache method before after and while i replace the surface images. No luck. I dynamically add and remove layers. Should i use a new layer list every time? (Tried but had no effect)

I also noticed the BMNGOneImage which i use underneath everything, in case the top layer is not yet loaded, disappears when i maximize the the panel containing WW.

Sometimes marker layers disappear when maximizing.
The loading icon with the dots (Status Layer) has serious painting problems (sometimes shows texture from other layers or just becomes a white rectangle).

I tried this on two different macs with no difference (One NVIDIA other ATI).

Please help i'm really stuck!

I tried using the path to the image instead of bufferedImage. Now i can sometimes restore (less than 5 percent of the cases).

tag
10-12-2010, 05:34 PM
WW is calling dispose on all the layers when the drawable's init method is called by JOGL. That effectively requires all layers to be recreated, which is extreme and inconvenient for the application. There's a TODO in the code to that effect. It's also extreme and inconvenient that the GL context is destroyed, thereby invalidating all object ids. But we don't have control of that.

So consider this a WW bug. We'll fix it, and it's important to fix, but I can't promise when that will happen. I'd expect within a few weeks, but again, no promises.

schwaller
10-12-2010, 06:28 PM
Thanks for the accurate and quick response. Reading about the "texture cache clear" workaround i got the impression it was already fixed.

Thanks anyway. As i need it now i will redesign my panel so it recreates all layers (which will mean a lot of pain regarding recreating the current measurement state etc., but once i'm done there is no need to hurry up fixing it ;)