diff options
author | Kenneth Russel <[email protected]> | 2006-12-21 19:52:20 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-12-21 19:52:20 +0000 |
commit | f19d491dc08aad401a9dd1de70405d188e3c4c1d (patch) | |
tree | 6c522baf2905e64972c66d5c333f63ad85e57b0b | |
parent | 5c30d022034785da5e0434f7a624696494b99b54 (diff) |
Added JOGL/JOAL applet test
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@187 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
-rwxr-xr-x | lib/README.txt | 2 | ||||
-rwxr-xr-x | lib/joal-demos.jar | bin | 0 -> 1080435 bytes | |||
-rwxr-xr-x | lib/joal.jar | bin | 0 -> 52166 bytes | |||
-rw-r--r-- | make/build.xml | 8 | ||||
-rwxr-xr-x | src/demos/applets/GearsJOALApplet.java | 52 |
5 files changed, 60 insertions, 2 deletions
diff --git a/lib/README.txt b/lib/README.txt new file mode 100755 index 0000000..af8df83 --- /dev/null +++ b/lib/README.txt @@ -0,0 +1,2 @@ +Note: the inclusion of these pre-built jar files is to facilitate the +building of the GearsJOALApplet example. diff --git a/lib/joal-demos.jar b/lib/joal-demos.jar Binary files differnew file mode 100755 index 0000000..05cc57c --- /dev/null +++ b/lib/joal-demos.jar diff --git a/lib/joal.jar b/lib/joal.jar Binary files differnew file mode 100755 index 0000000..ea66803 --- /dev/null +++ b/lib/joal.jar diff --git a/make/build.xml b/make/build.xml index 4de9a8c..c4dca21 100644 --- a/make/build.xml +++ b/make/build.xml @@ -41,6 +41,8 @@ <target name="init" depends="java.class.path.validate,setup.cg.excludes,skip.cg.excludes"> <property name="jogl.jar" value="../../jogl/build/jogl.jar" /> + <property name="joal.jar" value="../lib/joal.jar" /> + <property name="joal-demos.jar" value="../lib/joal-demos.jar" /> <property name="classes" value="../build/classes" /> <property name="src" value="../src" /> <property name="javadoc" value="../javadoc" /> @@ -54,12 +56,14 @@ <target name="all" depends="init"> <mkdir dir="${classes}" /> - <path id="jogl.classpath"> + <path id="jogl-demos.classpath"> <pathelement location="${jogl.jar}" /> + <pathelement location="${joal.jar}" /> + <pathelement location="${joal-demos.jar}" /> </path> <javac destdir="${classes}" excludes="${jogl.cg.excludes}" source="1.4" debug="true" debuglevel="source,lines"> <src path="${src}" /> - <classpath refid="jogl.classpath" /> + <classpath refid="jogl-demos.classpath" /> </javac> <jar destfile="${jogl.demos.jar}"> <fileset dir="${classes}"> diff --git a/src/demos/applets/GearsJOALApplet.java b/src/demos/applets/GearsJOALApplet.java new file mode 100755 index 0000000..e33733a --- /dev/null +++ b/src/demos/applets/GearsJOALApplet.java @@ -0,0 +1,52 @@ +package demos.applets; + +import java.applet.*; +import java.awt.*; +import java.io.*; +import javax.swing.*; + +import javax.media.opengl.*; +import com.sun.opengl.util.*; +import demos.gears.Gears; +import demos.devmaster.lesson1.*; +import net.java.games.joal.util.*; + +/** Shows how to deploy an applet using both JOGL and JOAL. This demo + must be referenced from a web page via an <applet> tag. */ + +public class GearsJOALApplet extends Applet { + private Animator animator; + + public void init() { + setLayout(new GridLayout(1, 2)); + GLCanvas canvas = new GLCanvas(); + canvas.addGLEventListener(new Gears()); + canvas.setSize(getSize()); + add(canvas); + JPanel joalDemoParent = new JPanel(); + SingleStaticSource joalDemo = new SingleStaticSource(true, joalDemoParent, false); + add(joalDemoParent); + animator = new FPSAnimator(canvas, 60); + } + + public void start() { + animator.start(); + } + + public void stop() { + // FIXME: do I need to do anything else here? + animator.stop(); + // Note that the SingleStaticSource demo does an alutInit() + // internally (on the Event Dispatch Thread), so we should do an + // alutExit() ourselves + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + ALut.alutExit(); + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } +} |