1.1b11 + multiple calls to init during resize

Is it normal to receive many calls to init(GLDrawawable) during resizing a drawable?

I’ve placed a GLJPanel inside a JInternalFrame and when I resize it, not only does init() get called many times on my GLEventListener during the resize but the performance degrades significantly.

This is a bug in JDK 1.4.2 fixed in 1.5.0. As far as I have found there is no good workaround we can put in JOGL.

That’s interesting. I’m using JDK 5.0.2.

Sorry, I was in a rush when I wrote my original reply. I realized about ten minutes later I was wrong.

There is a bug in 1.4.2 where focus changes in JInternalFrames cause addNotify / removeNotify to be called on the contained components. This isn’t what you’re seeing.

The GLJPanel has a backing pbuffer which is originally 256x256 and is resized in the X and Y axes by powers of two when the GLJPanel becomes larger than the pbuffer. Is this the effect you’re seeing, or are you seeing continuous calls to init() while you resize it? You should be able to reduce this effect by making the GLJPanel about as large as you expect it to become. You could also work around it by making it a large size for one frame and then immediately resizing it to a smaller size. Do these suggestions help?

The multiple calls to init was quite surprising to me. I assumed init() would only be called once, and used that section of code to establish my camera location. On subsequent init()s, the camera would jump back to the starting point, totally baffling the programmer! :slight_smile:

Can I suggest that the behavior be documented more prominently?

Thanks for the suggestion. I’ve added more documentation to GLEventListener.init() and the class documentation for GLJPanel. Let me know if you think more information is needed.