diff options
Diffstat (limited to 'src/jogl/classes')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/JoglVersion.java (renamed from src/jogl/classes/com/jogamp/opengl/util/VersionInfo.java) | 55 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLProfile.java | 9 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 14 |
3 files changed, 49 insertions, 29 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)); } } diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 5eb77d8bb..c5f5a8511 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -37,14 +37,16 @@ package javax.media.opengl; +import com.jogamp.common.GlueGenVersion; 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.nativewindow.NativeWindowVersion; import com.jogamp.opengl.impl.Debug; import com.jogamp.opengl.impl.GLDrawableFactoryImpl; import com.jogamp.opengl.impl.GLDynamicLookupHelper; import com.jogamp.opengl.impl.DesktopGLDynamicLookupHelper; +import com.jogamp.opengl.JoglVersion; import java.util.HashMap; import java.util.Iterator; import java.security.*; @@ -1060,8 +1062,9 @@ public class GLProfile { mappedProfiles = computeProfileMap(); if (DEBUG) { - 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(GlueGenVersion.getInstance().getInfo(null)); + System.err.println(NativeWindowVersion.getInstance().getInfo(null)); + System.err.print(JoglVersion.getInstance().getInfo(null)); System.err.println("GLProfile.init firstUIActionOnProcess "+firstUIActionOnProcess); System.err.println("GLProfile.init isAWTAvailable "+isAWTAvailable); System.err.println("GLProfile.init hasNativeOSFactory "+hasNativeOSFactory); diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index 22b25740c..9db718bfb 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -40,17 +40,19 @@ package javax.media.opengl.awt; +import com.jogamp.common.GlueGenVersion; +import com.jogamp.common.util.VersionUtil; +import com.jogamp.nativewindow.NativeWindowVersion; import javax.media.opengl.*; import javax.media.nativewindow.*; import javax.media.nativewindow.awt.*; import com.jogamp.opengl.impl.*; -import com.jogamp.opengl.util.VersionInfo; +import com.jogamp.opengl.JoglVersion; import java.awt.Canvas; import java.awt.Color; import java.awt.Component; -import java.awt.EventQueue; import java.awt.FontMetrics; import java.awt.Frame; import java.awt.Graphics; @@ -90,7 +92,6 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable { private AWTGraphicsConfiguration awtConfig; private GLDrawable drawable; private GLContextImpl context; - private boolean autoSwapBufferMode = true; private boolean sendReshape = false; // copy of the cstr args .. @@ -794,6 +795,10 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable { * A most simple JOGL AWT test entry */ public static void main(String args[]) { + System.err.println(GlueGenVersion.getInstance().getInfo(null)); + System.err.println(NativeWindowVersion.getInstance().getInfo(null)); + System.err.print(JoglVersion.getInstance().getInfo(null)); + GLCapabilities caps = new GLCapabilities( GLProfile.getDefault() ); Frame frame = new Frame("JOGL AWT Test"); @@ -804,8 +809,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable { glCanvas.addGLEventListener(new GLEventListener() { public void init(GLAutoDrawable drawable) { GL gl = drawable.getGL(); - String prefix = "JOGL AWT Test " + Thread.currentThread().getName(); - System.err.println(VersionInfo.getInfo(null, prefix, gl).toString()); + System.err.println(JoglVersion.getInstance().getGLInfo(gl, null)); } public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { |