Hi. We are using jogl to provide contexts and control access, but are using other (non-Java) libraries to do our OpenGL work. We need to know when a context is going away, so that we can clean up some things that we remember are in the context.
In the case that a window is closed, we’re currently getting a removeNotify(), and calling display on the GLAutoDrawable. Then, inside the display call back to the listener, we know the context is valid and clean up what we need to clean up. It would be really nice if there were a 5th call to the listener, which was called with the context current and before it went away. Since there isn’t, what do people do instead? I imagine it isn’t necessary for all those doing everything in Java, but I know we’re not the only ones who aren’t. Maybe someone else has an idea.
A different case is when we’re using the GLJPanel and resizing forces a new context to be built. We get an initialize() call for the next context, but by then it is too late to clean up the old one. We’re not getting GLEventListener reshape calls or resize calls from the components in time to do the trick we do for the close (calling the display). Any suggestions for this case?
thanks,
andy