summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-08-21 08:39:53 +0200
committerSven Gothel <[email protected]>2019-08-21 08:39:53 +0200
commit33531f146a5f92af65b458b422e673692806cecd (patch)
treef341217f139379994e208b0971a9660657e14fc1 /src
parent209bb2f0dc3418d168dc6887802bf4368b6d6f4e (diff)
JoglVersion.getGLInfo: Increase robustness of debug output
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/GLProfile.java13
-rw-r--r--src/jogl/classes/com/jogamp/opengl/JoglVersion.java15
2 files changed, 20 insertions, 8 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/GLProfile.java b/src/jogl/classes/com/jogamp/opengl/GLProfile.java
index 0e0d45444..9b96adf71 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLProfile.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLProfile.java
@@ -2031,11 +2031,14 @@ public class GLProfile {
final GLContext ctx = factory.getOrCreateSharedContext(device);
if(null != ctx) {
System.err.println("GLProfile.dumpGLInfo: "+ctx);
- ctx.makeCurrent();
- try {
- System.err.println(JoglVersion.getGLInfo(ctx.getGL(), null));
- } finally {
- ctx.release();
+ if( GLContext.CONTEXT_NOT_CURRENT != ctx.makeCurrent() ) {
+ try {
+ System.err.println(JoglVersion.getGLInfo(ctx.getGL(), null));
+ } finally {
+ ctx.release();
+ }
+ } else {
+ System.err.println("GLProfile.dumpGLInfo: Couldn't make context current");
}
} else {
System.err.println("GLProfile.dumpGLInfo: shared context n/a");
diff --git a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
index 92511dc11..b4692cdf6 100644
--- a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
+++ b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
@@ -36,7 +36,11 @@ import com.jogamp.common.util.JogampVersion;
import java.util.List;
import java.util.jar.Manifest;
+
+import com.jogamp.nativewindow.AbstractGraphicsConfiguration;
import com.jogamp.nativewindow.AbstractGraphicsDevice;
+import com.jogamp.nativewindow.AbstractGraphicsScreen;
+import com.jogamp.nativewindow.NativeSurface;
public class JoglVersion extends JogampVersion {
@@ -140,13 +144,18 @@ public class JoglVersion extends JogampVersion {
final boolean withAvailabilityInfo,
final boolean withCapabilitiesInfo,
final boolean withExtensionInfo) {
- final AbstractGraphicsDevice device = gl.getContext().getGLDrawable().getNativeSurface()
- .getGraphicsConfiguration().getScreen().getDevice();
if(null==sb) {
sb = new StringBuilder();
}
-
sb.append(VersionUtil.SEPERATOR).append(Platform.getNewline());
+ if( null == gl ) {
+ sb.append("Null GL instance").append(Platform.getNewline());
+ sb.append(VersionUtil.SEPERATOR).append(Platform.getNewline());
+ return sb;
+ }
+ final AbstractGraphicsDevice device = gl.getContext().getGLDrawable().getNativeSurface()
+ .getGraphicsConfiguration().getScreen().getDevice();
+
sb.append(device.toString()).append(':').append(Platform.getNewline());
if( withAvailabilityInfo ) {
GLProfile.glAvailabilityToString(device, sb, "\t", 1);