diff options
author | Sven Gothel <[email protected]> | 2010-12-15 12:32:37 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-12-15 12:32:37 +0100 |
commit | a7398aac183762174b0608ad7f83d9130c61523e (patch) | |
tree | 8fde45963a6e2c0b02c86cb25d9f09ed28bc14f5 /src | |
parent | 113c8a43457a11e53e3b088f53f997d0efd5aacf (diff) |
Add Version Applet
Diffstat (limited to 'src')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/impl/awt/opengl/VersionApplet.java | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/src/newt/classes/com/jogamp/newt/impl/awt/opengl/VersionApplet.java b/src/newt/classes/com/jogamp/newt/impl/awt/opengl/VersionApplet.java new file mode 100644 index 000000000..e306fe681 --- /dev/null +++ b/src/newt/classes/com/jogamp/newt/impl/awt/opengl/VersionApplet.java @@ -0,0 +1,88 @@ +package com.jogamp.newt.impl.awt.opengl; + +import com.jogamp.common.GlueGenVersion; +import com.jogamp.common.util.VersionUtil; +import com.jogamp.nativewindow.NativeWindowVersion; +import com.jogamp.newt.NewtVersion; +import com.jogamp.opengl.JoglVersion; +import java.applet.Applet; +import java.awt.BorderLayout; +import java.awt.TextArea; +import javax.media.opengl.GLProfile; +import javax.media.opengl.awt.GLCanvas; +import javax.media.opengl.GL; +import javax.media.opengl.GLAutoDrawable; +import javax.media.opengl.GLEventListener; + +public class VersionApplet extends Applet { + TextArea tarea; + + public void init() { + System.err.println("VersionApplet: init() - begin"); + GLProfile.initSingleton(false); + setLayout(new BorderLayout()); + String s; + + tarea = new TextArea(120, 80); + s = VersionUtil.getPlatformInfo().toString(); + System.err.println(s); + tarea.append(s); + + s = GlueGenVersion.getInstance().toString(); + System.err.println(s); + tarea.append(s); + + s = NativeWindowVersion.getInstance().toString(); + System.err.println(s); + tarea.append(NativeWindowVersion.getInstance().toString()); + + s = JoglVersion.getInstance().toString(); + System.err.println(s); + tarea.append(s); + + s = NewtVersion.getInstance().toString(); + System.err.println(s); + tarea.append(s); + + add(tarea, BorderLayout.CENTER); + + GLCanvas canvas = new GLCanvas(); + canvas.addGLEventListener(new GLInfo()); + add(canvas, BorderLayout.SOUTH); + System.err.println("VersionApplet: init() - end"); + } + + public void start() { + System.err.println("VersionApplet: start() - begin"); + System.err.println("VersionApplet: start() - end"); + } + + public void stop() { + // FIXME: do I need to do anything else here? + System.err.println("VersionApplet: stop() - begin"); + System.err.println("VersionApplet: stop() - end"); + } + + public void destroy() { + System.err.println("VersionApplet: destroy() - X"); + } + + class GLInfo implements GLEventListener { + public void init(GLAutoDrawable drawable) { + GL gl = drawable.getGL(); + String s = JoglVersion.getInstance().getGLInfo(gl, null).toString(); + System.err.println(s); + tarea.append(s); + } + + public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { + } + + public void display(GLAutoDrawable drawable) { + } + + public void dispose(GLAutoDrawable drawable) { + } + } + +} |