Loosing textures on resize

After adding a texture browser to my app, i’ve noticed that they will frequently dissapear and stop being displayed. When this happens it always conincides with some sort of window size change, such as dragging a edge of the app or maximising it. Sometimes I can even resize it a bit more and get the textures to come back…

I had thought that GL kept its textures regardless of maximise/minimise etc. so is Jogl quietly destroying and recreating something under the hood? Is this a known problem or am i the only one to see it?

Also, I noticed that sharing of textures between GL canavs’ is not supported, does this mean that if i want a main game view, and a separate GL canvas next to it as a texture browser that i’ll have to load all the textures again? Although it would be nice from a users point of view i’m not too keen on doubling my memory use for something like this :-/

JOGL doesn’t yet properly support destroying and recreating of contexts so if this is occurring then that’s your problem. However, resizing should work fine. It’s possible you’re running into multithreading problems of some kind, especially if you have animation going on and there’s a significant amount of state in your application. You also might try upgrading your OpenGL driver.

Sharing of texture objects between GLDrawables is supported as of the current (July 17) binary release of JOGL. Please see the current Javadocs which are available in the download section of the JOGL home page.

Hmm… when you say ‘multi-threading problems’ what do you mean? I’ve got a whole bunch of editing going on in the AWT event loop (don’t hit me yet, I know i’ve got to fix this) but it doesn’t touch the GL state in any way. Drivers were recent, er, about a month ago.
I’m not actually destroying it myself, just putting the GL canvas in a frame and letting it sort itself out.

I’ll have a look into the newest build and see if i can figure out texture sharing and such :slight_smile:

[quote]Hmm… when you say ‘multi-threading problems’ what do you mean? I’ve got a whole bunch of editing going on in the AWT event loop (don’t hit me yet, I know i’ve got to fix this) but it doesn’t touch the GL state in any way.
[/quote]
Problems can include changing some state in a KeyListener that is queried by the thread driven by an Animator. See the User’s Guide for some more detail (linked off the main JOGL page and checked in to the source tree).

[quote]I’ll have a look into the newest build and see if i can figure out texture sharing and such :slight_smile:
[/quote]
Take a look at the TestContextSharing demo that’s checked in to the jogl-demos source tree.

All my key/mouse listener code stays well clear of any GL code, and should be pretty much isolated. However I can think of no other explaination at the moment. The user guide pretty much confirms what i’m thinking as well (good, handy doc by the way :slight_smile: ).

I’m going to capture all the AWT messages and process them in the GL/Animator thread and see if that makes a difference (needs to be done anyway). Hopefully that’ll fix things. If not then i’ll have to get my app up to a testable state as quickly as possible to see how widespread the problem is…