summaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt')
-rw-r--r--src/newt/classes/com/jogamp/newt/NewtVersion.java60
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java12
2 files changed, 69 insertions, 3 deletions
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) {