summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-11-12 03:33:53 +0100
committerSven Gothel <[email protected]>2010-11-12 03:33:53 +0100
commitdac35658fb0b04e66f2e6cbce175090dcc48bde4 (patch)
tree67132669da41a0fd5a2ea9f6107246529794190d /src/jogl/classes/com/jogamp
parentc2e805f5cf9c209cfbd1a3082a347d9f3d58c9d5 (diff)
Adapt to GlueGen Version changes; Adding NativeWindowVersion, JoglVersion and NewtVersion.
Adapt to GlueGen Version changes: b735755815312b5fe2c003642de60711be1cd645 .. 556c7e70d3d57aa99b5787b1e4d8a7b1c299ed3f Show information of all subcomponenet.
Diffstat (limited to 'src/jogl/classes/com/jogamp')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/JoglVersion.java (renamed from src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java)55
1 files changed, 34 insertions, 21 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
index e04b75b6b..5fae77e1d 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java
+++ b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
@@ -26,60 +26,73 @@
* or implied, of JogAmp Community.
*/
-package com.jogamp.opengl.util;
+package com.jogamp.opengl;
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.jar.Manifest;
-public class VersionInfo {
+public class JoglVersion extends JogampVersion {
- public static StringBuffer getInfo(StringBuffer sb, String prefix) {
- return VersionUtil.getInfo(VersionInfo.class.getClassLoader(), prefix, "javax.media.opengl", "GL", sb);
+ protected static JoglVersion jogampCommonVersionInfo;
+
+ protected JoglVersion(String packageName, Manifest mf) {
+ super(packageName, mf);
}
- public static StringBuffer getInfo(StringBuffer sb, String prefix, GL gl) {
- if(null==sb) {
- sb = new StringBuffer();
+ public static JoglVersion getInstance() {
+ if(null == jogampCommonVersionInfo) {
+ synchronized(JoglVersion.class) {
+ if( null == jogampCommonVersionInfo ) {
+ final String packageName = "javax.media.opengl";
+ final String fullClazzName = "javax.media.opengl.GL";
+ final Manifest mf = VersionUtil.getManifest(JoglVersion.class.getClassLoader(), fullClazzName);
+ jogampCommonVersionInfo = new JoglVersion(packageName, mf);
+ }
+ }
}
+ return jogampCommonVersionInfo;
+ }
- VersionUtil.getInfo(VersionInfo.class.getClassLoader(), prefix, "javax.media.opengl", "GL", sb);
- sb.append("-----------------------------------------------------------------------------------------------------");
- sb.append(Platform.getNewline());
- getOpenGLInfo(sb, prefix, gl);
+ public StringBuffer getInfo(GL gl, StringBuffer sb) {
+ sb = super.getInfo(sb);
+
+ getGLInfo(gl, sb);
sb.append("-----------------------------------------------------------------------------------------------------");
sb.append(Platform.getNewline());
return sb;
}
- public static StringBuffer getOpenGLInfo(StringBuffer sb, String prefix, GL gl) {
+ public static StringBuffer getGLInfo(GL gl, StringBuffer sb) {
if(null==sb) {
sb = new StringBuffer();
}
- sb.append(prefix+" "+GLProfile.glAvailabilityToString());
+ sb.append(GLProfile.glAvailabilityToString());
sb.append(Platform.getNewline());
- sb.append(prefix+" Swap Interval " + gl.getSwapInterval());
+ sb.append("Swap Interval ").append(gl.getSwapInterval());
sb.append(Platform.getNewline());
- sb.append(prefix+" GL Profile " + gl.getGLProfile());
+ sb.append("GL Profile ").append(gl.getGLProfile());
sb.append(Platform.getNewline());
- sb.append(prefix+" CTX VERSION " + gl.getContext().getGLVersion());
+ sb.append("CTX VERSION ").append(gl.getContext().getGLVersion());
sb.append(Platform.getNewline());
- sb.append(prefix+" GL " + gl);
+ sb.append("GL ").append(gl);
sb.append(Platform.getNewline());
- sb.append(prefix+" GL_VERSION " + gl.glGetString(gl.GL_VERSION));
+ sb.append("GL_VERSION ").append(gl.glGetString(gl.GL_VERSION));
sb.append(Platform.getNewline());
- sb.append(prefix+" GL_EXTENSIONS ");
+ sb.append("GL_EXTENSIONS ");
sb.append(Platform.getNewline());
- sb.append(prefix+" " + gl.glGetString(gl.GL_EXTENSIONS));
+ sb.append(" ").append(gl.glGetString(gl.GL_EXTENSIONS));
sb.append(Platform.getNewline());
return sb;
}
public static void main(String args[]) {
- System.err.println(VersionInfo.getInfo(null, "JOGL"));
+ System.err.println(JoglVersion.getInstance().getInfo(null));
}
}