- Splash Screen must now be closed sooner. RocketFigure3d performs this task. This fixes a crash on Linux / X11.
- Check for "-Dopenrocket.3d.disable" and do no GL setup at all if this is defined. If users find GL cause OpenRocket to crash they may specify this option and use OR (Without 3d!)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@1005
180e2498-e6e9-4542-8430-
84ac67f01cd8
+2012-08-28 Bill Kuker
+
+ * Removed late GL initialization, was causing issues with Java 7.
+
+ * Added -Dopenrocket.3d.disable option for anyone experiencing crashes as a result of OpenGL.
+
2012-08-01 Kevin Ruland
* Changed the loader to pull *.rkt files from zip containers.
2012-08-01 Kevin Ruland
* Changed the loader to pull *.rkt files from zip containers.
Select the default locale to be used, for example "en_US".
If set to "xx", the logical keys will be displayed instead of the translated strings.
Select the default locale to be used, for example "en_US".
If set to "xx", the logical keys will be displayed instead of the translated strings.
+openrocket.3d.disable
+ Disables all OpenGL calls if set.
Logging options
---------------
Logging options
---------------
import java.awt.Point;\r
import java.awt.Rectangle;\r
import java.awt.RenderingHints;\r
import java.awt.Point;\r
import java.awt.Rectangle;\r
import java.awt.RenderingHints;\r
-import java.awt.event.HierarchyEvent;\r
-import java.awt.event.HierarchyListener;\r
+import java.awt.SplashScreen;\r
import java.awt.event.MouseEvent;\r
import java.awt.geom.AffineTransform;\r
import java.awt.image.BufferedImage;\r
import java.awt.event.MouseEvent;\r
import java.awt.geom.AffineTransform;\r
import java.awt.image.BufferedImage;\r
public RocketFigure3d(Configuration config) {\r
this.configuration = config;\r
this.setLayout(new BorderLayout());\r
public RocketFigure3d(Configuration config) {\r
this.configuration = config;\r
this.setLayout(new BorderLayout());\r
-\r
- /**\r
- * This achieves late GL initialization, so that if there is a crash\r
- * it does not occur until user selects 3D view, so as to not render\r
- * the application unusable.\r
- */\r
- addHierarchyListener(new HierarchyListener() {\r
- @Override\r
- public void hierarchyChanged(HierarchyEvent e) {\r
- log.verbose("GL - Calling initGLCanvas on hierarchy change");\r
- initGLCanvas();\r
- RocketFigure3d.this.removeHierarchyListener(this);\r
- }\r
- });\r
+ \r
+ //Only initizlize GL if 3d is enabled.\r
+ if ( is3dEnabled() ){\r
+ //Fixes a linux / X bug: Splash must be closed before GL Init\r
+ SplashScreen splash = SplashScreen.getSplashScreen();\r
+ if ( splash != null )\r
+ splash.close();\r
+ \r
+ initGLCanvas();\r
+ }\r
+ }\r
+ \r
+ /**\r
+ * Return true if 3d view is enabled. This may be toggled by the user at\r
+ * launch time.\r
+ * @return\r
+ */\r
+ public static boolean is3dEnabled(){\r
+ return System.getProperty("openrocket.3d.disable") == null;\r
}\r
\r
private void initGLCanvas(){\r
}\r
\r
private void initGLCanvas(){\r
+ toggle3d.setEnabled(RocketFigure3d.is3dEnabled());
add(toggle3d, "gap rel");
add(toggle3d, "gap rel");
// Zoom level selector
scaleSelector = new ScaleSelector(scrollPane);
add(scaleSelector);
// Zoom level selector
scaleSelector = new ScaleSelector(scrollPane);
add(scaleSelector);