Hi, I am encountering a bug wherby resizing a GLCanvas in a JFrame results in my 15" PowerBook with ATI Radeon 9700 to freeze completely. I can’t command-tab to a different app, I can’t access the dashboard, expose, or the dock, and my application does not respond to input from the mouse or keyboard. Sometimes the mouse pointer moves for a short time, but eventually that freezes too. Ultimately, I have to do a hard reboot.
I am running MacOS X 10.4.4 with Java 1.5 Release 4 Preview and JSR 231 beta 2. Reverting back to JOGL 1.1.1 I do not experience the problem.
I have been unsuccessful at producing a small test program that causes a crash, and every demo I’ve tried works fine too. I know that’s not particularly helpful, but there was one old issue that seemed very similar (Issue 67):
https://jogl.dev.java.net/issues/show_bug.cgi?id=67
but I can’t figure out why switching from JOGL 1.1.1 to JSR 231 would suddenly cause me to experience a similar issue, and I thought perhaps someone might have an idea for me to try.
Here’s a copy of the reshape method, which gets called every time a resize occurs; however, I can’t reliably break inside the method, which leads me to believe the error is caused on another thread, but I have no idea how or where yet. I know it’s not enough to run or test, but if you see something suspicious in it that could lead to problems, please let me know as well…
Thanks,
Corey
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
{
gl = drawable.getGL();
//glu = drawable.getGLU();
gl.glViewport(x, y, width, height);
resetProjection(drawable);
mapView.setPosition(15, height - 125);
updateNow = true;
}
/** In case window changes shape */
void resetProjection(GLAutoDrawable drawable)
{
if(width<0||height<0) return;
gl = drawable.getGL();
//glu = drawable.getGLU();
// Select The Projection Matrix
gl.glMatrixMode(GL.GL_PROJECTION);
// Reset The Projection Matrix
gl.glLoadIdentity();
// Calculate The Aspect Ratio Of The Window
System.out.println("Viewport: " + (int)width + ", " + (int)height);
gl.glViewport(0,0,(int)width,(int)height);
System.out.println("Perspective: " + (float)width / (float)height + ", " + depth);
glu.gluPerspective(30.0f, (float)width / (float)height, 0.1f, depth);
// Select The Modelview Matrix
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
// Reset the Camera
myCamera.restorePerspective();
myCamera.setCamera(this);
}