diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp')
4 files changed, 51 insertions, 16 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java index 5172cccbd..bf7eb0770 100644 --- a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java +++ b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java @@ -34,6 +34,8 @@ import javax.media.opengl.*; import com.jogamp.common.os.Platform; import com.jogamp.common.util.VersionUtil; import com.jogamp.common.util.JogampVersion; + +import java.util.List; import java.util.jar.Manifest; import javax.media.nativewindow.AbstractGraphicsDevice; @@ -68,6 +70,46 @@ public class JoglVersion extends JogampVersion { return toString(gl, null).toString(); } + public static StringBuilder getAvailableCapabilitiesInfo(GLDrawableFactory factory, AbstractGraphicsDevice device, StringBuilder sb) { + if(null==sb) { + sb = new StringBuilder(); + } + boolean done = false; + if(null!=factory) { + try { + final List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(device); + for(int i=0; i<availCaps.size(); i++) { + sb.append("\t").append(availCaps.get(i)).append(Platform.getNewline()); + } + done = true; + } catch (GLException gle) { /* n/a */ } + } + if(!done) { + sb.append("\tnone").append(Platform.getNewline()); + } + sb.append(Platform.getNewline()); + return sb; + } + + public static StringBuilder getDefaultOpenGLInfo(StringBuilder sb) { + if(null==sb) { + sb = new StringBuilder(); + } + final AbstractGraphicsDevice device = GLProfile.getDefaultDevice(); + sb.append("Default Profiles ").append(Platform.getNewline()); + if(null!=device) { + GLProfile.glAvailabilityToString(device, sb, "\t", 1); + } else { + sb.append("none"); + } + sb.append(Platform.getNewline()).append(Platform.getNewline()); + sb.append("Desktop Capabilities: ").append(Platform.getNewline()); + getAvailableCapabilitiesInfo(GLDrawableFactory.getDesktopFactory(), device, sb); + sb.append("EGL Capabilities: ").append(Platform.getNewline()); + getAvailableCapabilitiesInfo(GLDrawableFactory.getEGLFactory(), device, sb); + return sb; + } + public static StringBuilder getGLInfo(GL gl, StringBuilder sb) { AbstractGraphicsDevice device = gl.getContext().getGLDrawable().getNativeSurface() .getGraphicsConfiguration().getScreen().getDevice(); @@ -78,8 +120,8 @@ public class JoglVersion extends JogampVersion { sb.append(VersionUtil.SEPERATOR).append(Platform.getNewline()); sb.append(device.getClass().getSimpleName()).append("[type ") - .append(device.getType()).append(", connection ").append(device.getConnection()).append("]: ") - .append(GLProfile.glAvailabilityToString(device)); + .append(device.getType()).append(", connection ").append(device.getConnection()).append("]: ").append(Platform.getNewline()); + GLProfile.glAvailabilityToString(device, sb, "\t", 1); sb.append(Platform.getNewline()); sb.append("Swap Interval ").append(gl.getSwapInterval()); sb.append(Platform.getNewline()); @@ -91,7 +133,7 @@ public class JoglVersion extends JogampVersion { sb.append(Platform.getNewline()); sb.append("GL_VENDOR ").append(gl.glGetString(GL.GL_VENDOR)); sb.append(Platform.getNewline()); - sb.append("GL_RENDERER ").append(gl.glGetString(GL.GL_RENDERER)); + sb.append("GL_RENDERER ").append(gl.glGetString(GL.GL_RENDERER)); sb.append(Platform.getNewline()); sb.append("GL_VERSION ").append(gl.glGetString(GL.GL_VERSION)); sb.append(Platform.getNewline()); @@ -99,7 +141,7 @@ public class JoglVersion extends JogampVersion { sb.append(Platform.getNewline()); sb.append(" ").append(ctx.getGLExtensionsString()); sb.append(Platform.getNewline()); - sb.append("GLX_EXTENSIONS "); + sb.append("GLX_EXTENSIONS"); sb.append(Platform.getNewline()); sb.append(" ").append(ctx.getPlatformExtensionsString()); sb.append(Platform.getNewline()); diff --git a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java index c982ce16d..91f79793c 100644 --- a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java +++ b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java @@ -27,8 +27,6 @@ */ package com.jogamp.opengl.swt; -import java.util.List; - import javax.media.nativewindow.AbstractGraphicsDevice; import javax.media.nativewindow.NativeSurface; import javax.media.nativewindow.ProxySurface; @@ -538,13 +536,9 @@ public class GLCanvas extends Canvas implements GLAutoDrawable { // System.err.println(NativeWindowVersion.getInstance()); System.err.println(JoglVersion.getInstance()); - final GLDrawableFactory factory = GLDrawableFactory.getDesktopFactory(); - final List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(null); - for(int i=0; i<availCaps.size(); i++) { - System.err.println(availCaps.get(i)); - } - - final GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault(GLProfile.getDefaultDesktopDevice()) ); + System.err.println(JoglVersion.getDefaultOpenGLInfo(null).toString()); + + final GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault(GLProfile.getDefaultDevice()) ); final Display display = new Display(); final Shell shell = new Shell(display); shell.setSize(128,128); diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java index 747dd5c49..1f200bf3b 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java @@ -188,7 +188,7 @@ public class ShaderUtil { int[] param = new int[1]; shaderBinaryFormats = new HashSet<Integer>(); - if (gl.isGLES2()) { + if (gl.isGLES2Compatible()) { gl.glGetIntegerv(GL2ES2.GL_NUM_SHADER_BINARY_FORMATS, param, 0); int numFormats = param[0]; if(numFormats>0) { @@ -329,7 +329,6 @@ public class ShaderUtil { throw new GLException("createAndLoadShader: CreateShader failed, GL Error: 0x"+Integer.toHexString(err)); } - shaderBinary(gl, shader, binFormat, bin); err = gl.glGetError(); diff --git a/src/jogl/classes/com/jogamp/openmax/OMXInstance.java b/src/jogl/classes/com/jogamp/openmax/OMXInstance.java index fcd055f8b..7c373a0ef 100644 --- a/src/jogl/classes/com/jogamp/openmax/OMXInstance.java +++ b/src/jogl/classes/com/jogamp/openmax/OMXInstance.java @@ -472,7 +472,7 @@ public class OMXInstance { private void errorCheckEGL(String s) { int e; if( (e=EGL.eglGetError()) != EGL.EGL_SUCCESS ) { - System.out.println("EGL Error: ("+s+"): "+e); + System.out.println("EGL Error: ("+s+"): 0x"+Integer.toHexString(e)); } } |