From 0893339854e3f4a4fab7b19e073304973e763b10 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 10 Nov 2010 11:22:29 +0100 Subject: Use GlueGen VersionUtil to dump full Manifest version --- .../com/jogamp/opengl/util/VersionInfo.java | 70 +++------------------- src/jogl/classes/javax/media/opengl/GLProfile.java | 5 +- 2 files changed, 12 insertions(+), 63 deletions(-) (limited to 'src/jogl') diff --git a/src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java b/src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java index b7e6b5194..e04b75b6b 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java +++ b/src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java @@ -30,49 +30,29 @@ package com.jogamp.opengl.util; import javax.media.opengl.*; import com.jogamp.common.os.Platform; - -import java.io.IOException; +import com.jogamp.common.util.VersionUtil; public class VersionInfo { + public static StringBuffer getInfo(StringBuffer sb, String prefix) { + return VersionUtil.getInfo(VersionInfo.class.getClassLoader(), prefix, "javax.media.opengl", "GL", sb); + } + public static StringBuffer getInfo(StringBuffer sb, String prefix, GL gl) { if(null==sb) { sb = new StringBuffer(); } - sb.append(Platform.getNewline()); + VersionUtil.getInfo(VersionInfo.class.getClassLoader(), prefix, "javax.media.opengl", "GL", sb); sb.append("-----------------------------------------------------------------------------------------------------"); sb.append(Platform.getNewline()); - getPackageInfo(sb, prefix, "javax.media.opengl", "GL"); - sb.append(Platform.getNewline()); - sb.append(Platform.getNewline()); - getPlatformInfo(sb, prefix); - sb.append(Platform.getNewline()); - sb.append(Platform.getNewline()); getOpenGLInfo(sb, prefix, gl); - sb.append(Platform.getNewline()); - sb.append(Platform.getNewline()); sb.append("-----------------------------------------------------------------------------------------------------"); sb.append(Platform.getNewline()); return sb; } - public static StringBuffer getPlatformInfo(StringBuffer sb, String prefix) { - if(null==sb) { - sb = new StringBuffer(); - } - - sb.append(prefix+" Platform: " + Platform.getOS() + " " + Platform.getOSVersion() + " (os), " + Platform.getArch() + " (arch)"); - sb.append(Platform.getNewline()); - sb.append(prefix+" Platform: littleEndian " + Platform.isLittleEndian() + ", 32Bit "+Platform.is32Bit() + ", a-ptr bit-size "+Platform.getPointerSizeInBits()); - sb.append(Platform.getNewline()); - sb.append(prefix+" Platform: Java " + Platform.getJavaVersion()+", " - +Platform.getJavaVendor()+", "+Platform.getJavaVendorURL()+", is JavaSE: "+Platform.isJavaSE()); - - return sb; - } - public static StringBuffer getOpenGLInfo(StringBuffer sb, String prefix, GL gl) { if(null==sb) { sb = new StringBuffer(); @@ -93,45 +73,13 @@ public class VersionInfo { sb.append(prefix+" GL_EXTENSIONS "); sb.append(Platform.getNewline()); sb.append(prefix+" " + gl.glGetString(gl.GL_EXTENSIONS)); + sb.append(Platform.getNewline()); return sb; } - public static StringBuffer getPackageInfo(StringBuffer sb, String prefix, - String pkgName, String className) { - try { - ClassLoader classLoader = VersionInfo.class.getClassLoader(); - classLoader.loadClass(pkgName + "." + className); - - if(null==sb) { - sb = new StringBuffer(); - } - - Package p = Package.getPackage(pkgName); - if (p == null) { - sb.append(prefix+" WARNING: Package.getPackage(" + pkgName + ") is null"); - sb.append(Platform.getNewline()); - } - else { - sb.append(prefix+" "+p); - sb.append(Platform.getNewline()); - sb.append(prefix+" Specification Title = " + p.getSpecificationTitle()); - sb.append(Platform.getNewline()); - sb.append(prefix+" Specification Vendor = " + p.getSpecificationVendor()); - sb.append(Platform.getNewline()); - sb.append(prefix+" Specification Version = " + p.getSpecificationVersion()); - sb.append(Platform.getNewline()); - - sb.append(prefix+" Implementation Vendor = " + p.getImplementationVendor()); - sb.append(Platform.getNewline()); - sb.append(prefix+" Implementation Version = " + p.getImplementationVersion()); - } - } - catch (ClassNotFoundException e) { - sb.append(Platform.getNewline()); - sb.append(prefix+" Unable to load " + pkgName); - } - return sb; + public static void main(String args[]) { + System.err.println(VersionInfo.getInfo(null, "JOGL")); } } diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 853d3e888..5eb77d8bb 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -39,6 +39,7 @@ package javax.media.opengl; import com.jogamp.common.jvm.JVMUtil; import com.jogamp.common.util.ReflectionUtil; +import com.jogamp.common.util.VersionUtil; import com.jogamp.opengl.util.VersionInfo; import com.jogamp.opengl.impl.Debug; import com.jogamp.opengl.impl.GLDrawableFactoryImpl; @@ -1059,8 +1060,8 @@ public class GLProfile { mappedProfiles = computeProfileMap(); if (DEBUG) { - System.err.println(VersionInfo.getPackageInfo(null, "GLProfile.init", "javax.media.opengl", "GL")); - System.err.println(VersionInfo.getPlatformInfo(null, "GLProfile.init")); + System.err.print(VersionUtil.getPlatformInfo(null, "GLProfile.init")); + System.err.print(VersionUtil.getManifestInfo(GLProfile.class.getClassLoader(), "GLProfile.init", "javax.media.opengl", "GL", null)); System.err.println("GLProfile.init firstUIActionOnProcess "+firstUIActionOnProcess); System.err.println("GLProfile.init isAWTAvailable "+isAWTAvailable); System.err.println("GLProfile.init hasNativeOSFactory "+hasNativeOSFactory); -- cgit v1.2.3