Give a string description to each place I enter or leave the GL DangerZone
This commit is contained in:
parent
02360f89dd
commit
b82be4fc02
@ -41,7 +41,7 @@ public class OpenGLUtils {
|
||||
log.debug("OpenGL is disabled");
|
||||
} else {
|
||||
log.debug("Initializing OpenGL");
|
||||
enterDangerZone();
|
||||
enterDangerZone("earlyInitialize");
|
||||
if (SystemInfo.getPlatform() == Platform.UNIX) {
|
||||
log.debug("Dismissing splash screen (Linux/Java/JOGL bug)");
|
||||
// Fixes a linux / X bug: Splash must be closed before GL Init
|
||||
@ -56,7 +56,7 @@ public class OpenGLUtils {
|
||||
}
|
||||
log.debug("Calling GLProfile.initSingleton()");
|
||||
GLProfile.initSingleton();
|
||||
exitDangerZone();
|
||||
exitDangerZone("earlyInitialize");
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,8 +76,8 @@ public class OpenGLUtils {
|
||||
* exitDangerZone is not called after this the 3D user preference will be
|
||||
* disabled at the next startup.
|
||||
*/
|
||||
static void enterDangerZone() {
|
||||
log.verbose("Entering GL DangerZone");
|
||||
static void enterDangerZone(String where) {
|
||||
log.verbose("Entering GL DangerZone: " + where);
|
||||
inTheDangerZone = true;
|
||||
Application.getPreferences().set3dEnabled(false);
|
||||
try {
|
||||
@ -93,11 +93,11 @@ public class OpenGLUtils {
|
||||
*
|
||||
* Safe to call when not in the danger-zone. Safe to call quite often
|
||||
*/
|
||||
static void exitDangerZone() {
|
||||
static void exitDangerZone(String where) {
|
||||
if (!inTheDangerZone)
|
||||
return;
|
||||
inTheDangerZone = false;
|
||||
log.verbose("Exiting GL DangerZone");
|
||||
log.verbose("Exiting GL DangerZone: " + where);
|
||||
Application.getPreferences().set3dEnabled(true);
|
||||
try {
|
||||
Preferences.userRoot().flush();
|
||||
|
@ -97,7 +97,7 @@ public class RocketFigure3d extends JPanel implements GLEventListener {
|
||||
addHierarchyListener(new HierarchyListener(){
|
||||
@Override
|
||||
public void hierarchyChanged(HierarchyEvent e) {
|
||||
OpenGLUtils.enterDangerZone();
|
||||
OpenGLUtils.enterDangerZone("RocketFigure3d added to parent container");
|
||||
RocketFigure3d.this.removeHierarchyListener(this);
|
||||
}
|
||||
});
|
||||
@ -134,7 +134,7 @@ public class RocketFigure3d extends JPanel implements GLEventListener {
|
||||
|
||||
private void initGLCanvas() {
|
||||
log.debug("Initializing RocketFigure3D OpenGL Canvas");
|
||||
OpenGLUtils.enterDangerZone();
|
||||
OpenGLUtils.enterDangerZone("initGLCanvas");
|
||||
try {
|
||||
log.debug("Setting up GL capabilities...");
|
||||
|
||||
@ -174,7 +174,7 @@ public class RocketFigure3d extends JPanel implements GLEventListener {
|
||||
this.add(new JLabel("Unable to load 3d Libraries: "
|
||||
+ t.getMessage()));
|
||||
} finally {
|
||||
OpenGLUtils.exitDangerZone();
|
||||
OpenGLUtils.exitDangerZone("initGLCanvas");
|
||||
}
|
||||
}
|
||||
|
||||
@ -314,7 +314,7 @@ public class RocketFigure3d extends JPanel implements GLEventListener {
|
||||
drawExtras(gl, glu);
|
||||
drawCarets(gl, glu);
|
||||
|
||||
OpenGLUtils.exitDangerZone();
|
||||
OpenGLUtils.exitDangerZone("display()");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user