aboutsummaryrefslogtreecommitdiffstats
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
parentc2e805f5cf9c209cfbd1a3082a347d9f3d58c9d5 (diff)
Adapt to GlueGen Version changes; Adding NativeWindowVersion, JoglVersion and NewtVersion.
Adapt to GlueGen Version changes: b735755815312b5fe2c003642de60711be1cd645 .. 556c7e70d3d57aa99b5787b1e4d8a7b1c299ed3f Show information of all subcomponenet.
-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.java9
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLCanvas.java14
-rw-r--r--src/junit/com/jogamp/test/junit/util/DumpVersion.java13
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java60
-rw-r--r--src/newt/classes/com/jogamp/newt/NewtVersion.java60
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java12
7 files changed, 180 insertions, 43 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) {
diff --git a/src/junit/com/jogamp/test/junit/util/DumpVersion.java b/src/junit/com/jogamp/test/junit/util/DumpVersion.java
index df07c5bcf..beefa4aaf 100644
--- a/src/junit/com/jogamp/test/junit/util/DumpVersion.java
+++ b/src/junit/com/jogamp/test/junit/util/DumpVersion.java
@@ -28,26 +28,17 @@
package com.jogamp.test.junit.util;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.AfterClass;
-import org.junit.Test;
import javax.media.opengl.*;
-import com.jogamp.opengl.util.VersionInfo;
-import com.jogamp.common.os.Platform;
+import com.jogamp.opengl.JoglVersion;
-import java.io.IOException;
public class DumpVersion implements GLEventListener {
public void init(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
- String prefix = Thread.currentThread().getName();
-
- System.err.println(VersionInfo.getInfo(null, prefix, gl).toString());
+ System.err.println(JoglVersion.getInstance().getInfo(gl, null));
}
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
new file mode 100644
index 000000000..a3dee0d07
--- /dev/null
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
@@ -0,0 +1,60 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.nativewindow;
+
+import com.jogamp.common.util.JogampVersion;
+import com.jogamp.common.util.VersionUtil;
+import java.util.jar.Manifest;
+
+public class NativeWindowVersion extends JogampVersion {
+
+ protected static NativeWindowVersion jogampCommonVersionInfo;
+
+ protected NativeWindowVersion(String packageName, Manifest mf) {
+ super(packageName, mf);
+ }
+
+ public static NativeWindowVersion getInstance() {
+ if(null == jogampCommonVersionInfo) {
+ synchronized(NativeWindowVersion.class) {
+ if( null == jogampCommonVersionInfo ) {
+ final String packageName = "javax.media.nativewindow";
+ final String fullClazzName = NativeWindowVersion.class.getName();
+ final Manifest mf = VersionUtil.getManifest(NativeWindowVersion.class.getClassLoader(), fullClazzName);
+ jogampCommonVersionInfo = new NativeWindowVersion(packageName, mf);
+ }
+ }
+ }
+ return jogampCommonVersionInfo;
+ }
+
+ public static void main(String args[]) {
+ System.err.println(NativeWindowVersion.getInstance().getInfo(null));
+ }
+}
diff --git a/src/newt/classes/com/jogamp/newt/NewtVersion.java b/src/newt/classes/com/jogamp/newt/NewtVersion.java
new file mode 100644
index 000000000..ad173605c
--- /dev/null
+++ b/src/newt/classes/com/jogamp/newt/NewtVersion.java
@@ -0,0 +1,60 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.newt;
+
+import com.jogamp.common.util.JogampVersion;
+import com.jogamp.common.util.VersionUtil;
+import java.util.jar.Manifest;
+
+public class NewtVersion extends JogampVersion {
+
+ protected static NewtVersion jogampCommonVersionInfo;
+
+ protected NewtVersion(String packageName, Manifest mf) {
+ super(packageName, mf);
+ }
+
+ public static NewtVersion getInstance() {
+ if(null == jogampCommonVersionInfo) {
+ synchronized(NewtVersion.class) {
+ if( null == jogampCommonVersionInfo ) {
+ final String packageName = "com.jogamp.newt";
+ final String fullClazzName = NewtVersion.class.getName();
+ final Manifest mf = VersionUtil.getManifest(NewtVersion.class.getClassLoader(), fullClazzName);
+ jogampCommonVersionInfo = new NewtVersion(packageName, mf);
+ }
+ }
+ }
+ return jogampCommonVersionInfo;
+ }
+
+ public static void main(String args[]) {
+ System.err.println(NewtVersion.getInstance().getInfo(null));
+ }
+}
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index b1ad2fd26..714fe20f2 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -34,6 +34,9 @@
package com.jogamp.newt.opengl;
+import com.jogamp.common.GlueGenVersion;
+import com.jogamp.common.util.VersionUtil;
+import com.jogamp.nativewindow.NativeWindowVersion;
import com.jogamp.newt.*;
import com.jogamp.newt.event.*;
import com.jogamp.newt.impl.WindowImpl;
@@ -41,7 +44,7 @@ import javax.media.nativewindow.*;
import javax.media.nativewindow.util.Point;
import javax.media.opengl.*;
import com.jogamp.opengl.impl.GLDrawableHelper;
-import com.jogamp.opengl.util.VersionInfo;
+import com.jogamp.opengl.JoglVersion;
import javax.media.nativewindow.util.Insets;
/**
@@ -846,6 +849,10 @@ public class GLWindow implements GLAutoDrawable, Window {
* 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));
+ System.err.println(NewtVersion.getInstance().getInfo(null));
GLCapabilities caps = new GLCapabilities( GLProfile.getDefault() );
GLWindow glWindow = GLWindow.create(caps);
@@ -854,8 +861,7 @@ public class GLWindow implements GLAutoDrawable, Window {
glWindow.addGLEventListener(new GLEventListener() {
public void init(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
- String prefix = "JOGL NEWT 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) {