diff options
author | Sven Gothel <[email protected]> | 2012-02-13 07:00:01 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-02-13 07:00:01 +0100 |
commit | 4011e70eed8c88aee0fcd051a50ab3f15bb94f68 (patch) | |
tree | e7fb1c33d4c0e75fc52dc3ec2d927f76c51de216 /src/jogl/classes/com/jogamp/opengl/JoglVersion.java | |
parent | ddd375375025fb83aba90c80b9a089876dad5434 (diff) |
OpenGL ES/EGL Overhaul
- GLProfile properly detects native EGL/ES1/ES2 on the 'desktop' device factory.
This allows usage of Mesa's EGL/ES or Imageon's PVR emulation, etc.
- GLProfile drops getDefaultDesktopDevice() and getDefaultEGLDevice()
since both are aligned by getDefaultDevice().
- Fix GL_ARB_ES2_compatibility detection and utilize
resulting isGLES2Compatible() where possible.
This allows ES2 compatible desktop profiles to use core ES2 functionality
(glShaderBinary() .. etc) even with a GL2ES2 desktop implementation.
- EGLDrawable: If createSurface(..) fails (BAD_NATIVE_WINDOW) w/ surfaceHandle
it uses windowHandle if available and differs.
This allows the ANGLE impl. to work.
- Properly order of EGL/ES library lookup:
ES2: libGLESv2.so.2, libGLESv2.so, GLES20, GLESv2_CM
EGL: libEGL.so.1, libEGL.so, EGL
- *DynamicLookupHelper reference will be null if it's library is not complete
(all tool libs, all glue libs and a ProcAddressFunc lookup function - if named).
- Enhance GL version string (incl. ES2 compatible, hw/sw, ..)
- GLBase: Fix docs and remove redundancies
- Prepared (disabled) DesktopES2DynamicLibraryBundleInfo
to be used for a real EGL/ES2 implementation within the desktop GL lib (AMD).
Sadly it currenly crashed within eglGetDisplay(EGL_DEFAULT_DISPLAY),
hence it's disabled.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/JoglVersion.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/JoglVersion.java | 50 |
1 files changed, 46 insertions, 4 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()); |