- Remove GL Late-initialization. GL is now set up when RocketFigure3d is constructed. This fixes a crash / hang on Java 7.
- 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!)
This commit is contained in:
parent
d70cc32dd6
commit
0fd4ada18d
@ -1,3 +1,9 @@
|
||||
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.
|
||||
|
@ -9,7 +9,8 @@ openrocket.locale
|
||||
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
|
||||
---------------
|
||||
|
@ -6,8 +6,7 @@ import java.awt.Graphics2D;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.event.HierarchyEvent;
|
||||
import java.awt.event.HierarchyListener;
|
||||
import java.awt.SplashScreen;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.BufferedImage;
|
||||
@ -86,20 +85,25 @@ public class RocketFigure3d extends JPanel implements GLEventListener {
|
||||
public RocketFigure3d(Configuration config) {
|
||||
this.configuration = config;
|
||||
this.setLayout(new BorderLayout());
|
||||
|
||||
/**
|
||||
* This achieves late GL initialization, so that if there is a crash
|
||||
* it does not occur until user selects 3D view, so as to not render
|
||||
* the application unusable.
|
||||
*/
|
||||
addHierarchyListener(new HierarchyListener() {
|
||||
@Override
|
||||
public void hierarchyChanged(HierarchyEvent e) {
|
||||
log.verbose("GL - Calling initGLCanvas on hierarchy change");
|
||||
initGLCanvas();
|
||||
RocketFigure3d.this.removeHierarchyListener(this);
|
||||
}
|
||||
});
|
||||
|
||||
//Only initizlize GL if 3d is enabled.
|
||||
if ( is3dEnabled() ){
|
||||
//Fixes a linux / X bug: Splash must be closed before GL Init
|
||||
SplashScreen splash = SplashScreen.getSplashScreen();
|
||||
if ( splash != null )
|
||||
splash.close();
|
||||
|
||||
initGLCanvas();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if 3d view is enabled. This may be toggled by the user at
|
||||
* launch time.
|
||||
* @return
|
||||
*/
|
||||
public static boolean is3dEnabled(){
|
||||
return System.getProperty("openrocket.3d.disable") == null;
|
||||
}
|
||||
|
||||
private void initGLCanvas(){
|
||||
|
@ -285,9 +285,9 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
||||
}
|
||||
});
|
||||
bg.add(toggle3d);
|
||||
toggle3d.setEnabled(RocketFigure3d.is3dEnabled());
|
||||
add(toggle3d, "gap rel");
|
||||
|
||||
|
||||
// Zoom level selector
|
||||
scaleSelector = new ScaleSelector(scrollPane);
|
||||
add(scaleSelector);
|
||||
|
Loading…
x
Reference in New Issue
Block a user