summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlib/README.txt2
-rwxr-xr-xlib/joal-demos.jarbin0 -> 1080435 bytes
-rwxr-xr-xlib/joal.jarbin0 -> 52166 bytes
-rw-r--r--make/build.xml8
-rwxr-xr-xsrc/demos/applets/GearsJOALApplet.java52
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
new file mode 100755
index 0000000..05cc57c
--- /dev/null
+++ b/lib/joal-demos.jar
Binary files differ
diff --git a/lib/joal.jar b/lib/joal.jar
new file mode 100755
index 0000000..ea66803
--- /dev/null
+++ b/lib/joal.jar
Binary files differ
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 &lt;applet&gt; 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();
+ }
+ }
+}