aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp')
-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);