summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-04-05 02:23:11 +0200
committerSven Gothel <[email protected]>2013-04-05 02:23:11 +0200
commit5e3563d7dab16384bcc381e24b741fa651f2f3cd (patch)
treec33f22f126bc35bf9c37118ca43dc9412537a9b3
parente68566febb69f6aca4bdf39d1d841c17df894631 (diff)
Bug 713: Handle broken EGL setup - Catch all Exception types, not only JogampRuntimeException at *DrawableFactory* instantiation trial
In case EGL is not completly installed, EGLDisplayUtil.eglGetDisplayAndInitialize(..) will throw a GLExeception which was not catched in GLDrawableFactory. The latter only catched JogampRuntimeException caused by ReflectionUtil due to n/a classes, but the actual initialization code is capable to throw others.
-rw-r--r--src/jogl/classes/javax/media/opengl/GLDrawableFactory.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java3
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java3
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java3
4 files changed, 5 insertions, 10 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index 7fcd913cf..9d5bd0524 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -45,8 +45,6 @@ import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.List;
-import com.jogamp.common.JogampRuntimeException;
-
import com.jogamp.common.util.ReflectionUtil;
import com.jogamp.opengl.GLAutoDrawableDelegate;
import com.jogamp.opengl.GLRendererQuirks;
@@ -174,7 +172,7 @@ public abstract class GLDrawableFactory {
}
try {
tmp = (GLDrawableFactory) ReflectionUtil.createInstance(factoryClassName, cl);
- } catch (JogampRuntimeException jre) {
+ } catch (Exception jre) {
if (DEBUG || GLProfile.DEBUG) {
System.err.println("Info: GLDrawableFactory.static - Native Platform: "+nwt+" - not available: "+factoryClassName);
jre.printStackTrace();
@@ -189,7 +187,7 @@ public abstract class GLDrawableFactory {
if(!disableOpenGLES) {
try {
tmp = (GLDrawableFactory) ReflectionUtil.createInstance("jogamp.opengl.egl.EGLDrawableFactory", cl);
- } catch (JogampRuntimeException jre) {
+ } catch (Exception jre) {
if (DEBUG || GLProfile.DEBUG) {
System.err.println("Info: GLDrawableFactory.static - EGLDrawableFactory - not available");
jre.printStackTrace();
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
index ad305ab37..b390621fa 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
@@ -72,7 +72,6 @@ import jogamp.opengl.GLDrawableImpl;
import jogamp.opengl.GLDynamicLookupHelper;
import jogamp.opengl.GLGraphicsConfigurationUtil;
-import com.jogamp.common.JogampRuntimeException;
import com.jogamp.common.nio.Buffers;
import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.common.os.Platform;
@@ -116,7 +115,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
if(NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(true)) {
try {
ReflectionUtil.createInstance("jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory", EGLDrawableFactory.class.getClassLoader());
- } catch (JogampRuntimeException jre) { /* n/a .. */ }
+ } catch (Exception jre) { /* n/a .. */ }
}
// FIXME: Probably need to move EGL from a static model
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
index ae2082d67..aaca7c78a 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
@@ -69,7 +69,6 @@ import jogamp.opengl.GLDrawableImpl;
import jogamp.opengl.GLDynamicLookupHelper;
import jogamp.opengl.GLGraphicsConfigurationUtil;
-import com.jogamp.common.JogampRuntimeException;
import com.jogamp.common.nio.Buffers;
import com.jogamp.common.util.ReflectionUtil;
import com.jogamp.nativewindow.MutableGraphicsConfiguration;
@@ -112,7 +111,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
try {
ReflectionUtil.callStaticMethod("jogamp.opengl.macosx.cgl.awt.MacOSXAWTCGLGraphicsConfigurationFactory",
"registerFactory", null, null, getClass().getClassLoader());
- } catch (JogampRuntimeException jre) { /* n/a .. */ }
+ } catch (Exception jre) { /* n/a .. */ }
}
sharedMap = new HashMap<String, SharedResource>();
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
index 9c96f3e3c..aea0d7973 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -75,7 +75,6 @@ import jogamp.opengl.GLDynamicLookupHelper;
import jogamp.opengl.GLGraphicsConfigurationUtil;
import jogamp.opengl.SharedResourceRunner;
-import com.jogamp.common.JogampRuntimeException;
import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.ReflectionUtil;
@@ -116,7 +115,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
try {
ReflectionUtil.callStaticMethod("jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory",
"registerFactory", null, null, getClass().getClassLoader());
- } catch (JogampRuntimeException jre) { /* n/a .. */ }
+ } catch (Exception jre) { /* n/a .. */ }
}
sharedMap = new HashMap<String, SharedResourceRunner.Resource>();