GLCanvas resizing issue on Mac OSX 10.8.2
Posted by
Eric on
Dec 07, 2012; 2:22pm
URL: https://forum.jogamp.org/GLCanvas-resizing-issue-on-Mac-OSX-10-8-2-tp4027445.html
I have recently integrated JOGL into our AWT application. So far everything works quite well, but there is one significant problem that just kills usability. Allow me to explain:
-
All my instances of GLCanvas are contained within instances of JPanel using the following approach:
jpanel.setLayout( new BorderLayout() );
jpanel.add( glCanvas, BorderLayout.CENTER );
-
When the panel appears at first, everything displays perfectly fine.

-
When I reduce the size of the containing JPanel (via dragging the divider of a parent JSplitPane or resizing the parent window, doesn't matter), everything is consistent.

-
Here's where the problem begins to happen. When I increase the size of the containing JPanel, the drawn area remains the same as the JPanel's smallest dimension since it's initialization. All the contents that should be drawn over the area of the entire JPanel are instead scaled down to draw into a sub-region that sticks to the bottom-left of the panel (the GL clear color is bright pink/purple).
Here are a few solutions I have tried without much success:
-
I tried resetting the JPanel's and the GLCanvas' minimum and preferred size to (0,0) and panel.getSize() when the resize happens, as per suggestions I found online from people having similar issues. Neither have been successful or have had any effect.
-
Ensured that the glViewport and glOrtho2D were being properly set.
-
Tried using GLJPanel instead of a JPanel, but got the same result.
-
Tried invalidating the involved components.
-
I am currently on JRE 1.6.0_37 (JDK6) (the one bundled with my OS). I tried with the lastest version of JRE 1.7 (JDK7), but the same thing happened and everything felt a bit less stable so I rolled back.
-
Updated to the latest release of JOGL (the one from November). I found the following issue that corresponds closely to my problem. A bug was filed for it and claimed to be fixed, so I wanted to make sure I had the fix.
-
All imaginable combinations of the above and probably a few more things. I've wasted a lot of time on this, basically...
Also important to note: When I look at values through the debugger, everything adds up correctly and the numbers are what they should be from what I can see. That's primarily what makes me believe that the issue is a bit deeper.
I have no other platforms available to me at the moment (e.g. a Windows machine), so I haven't seen if the issue is platform dependent, but I suspect it is.
Any help in getting this resolved would be greatly appreciated.
Thank you for your time.