diff options
author | Sven Gothel <[email protected]> | 2010-12-19 01:04:38 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-12-19 01:04:38 +0100 |
commit | 3f92d13a9f886b044f8f1c49ff22476e30ba408d (patch) | |
tree | 40b6ec2cb6c74577f573da9267287bad3fc3b0d7 | |
parent | df1bf4aa61c75bc27b630d58691aa9ee09ad046e (diff) |
Unique ZIP archive name ; Gears main init sequence
-rw-r--r-- | make/build.xml | 6 | ||||
-rw-r--r-- | src/demos/gears/Gears.java | 31 |
2 files changed, 24 insertions, 13 deletions
diff --git a/make/build.xml b/make/build.xml index 6855233..518c8aa 100644 --- a/make/build.xml +++ b/make/build.xml @@ -30,6 +30,8 @@ <property name="gluegen.root" value="${project.root}/../gluegen" /> <property name="gluegen.build" value="${gluegen.root}/${rootrel.build}" /> + <!-- Pull in GlueGen cpptasks build file --> + <import file="${gluegen.root}/make/gluegen-cpptasks.xml" /> <property name="jogl.root" value="${project.root}/../jogl" /> <property name="jogl.build" value="${jogl.root}/${rootrel.build}" /> @@ -89,7 +91,7 @@ <property name="swt.jar" value="${user.swt.jar}"/> </target> - <target name="init" depends="java.class.path.validate,setup.gles,setup.cg.excludes,skip.cg.excludes,init.swt"> + <target name="init" depends="gluegen.cpptasks.detect.os,java.class.path.validate,setup.gles,setup.cg.excludes,skip.cg.excludes,init.swt"> <property name="jogl.core.jar" value="${jogl.build}/jogl/jogl.core.jar" /> <condition property="jogl.cg.jar" value="${jogl.build}/jogl/jogl.cg.jar"> <isset property="jogl.cg"/> @@ -125,7 +127,7 @@ <property name="jogl.demos.jar" value="${build}/jogl-demos.jar" /> <property name="jogl.demos.util.jar" value="${build}/jogl-demos-util.jar" /> <property name="jogl.demos.data.jar" value="${build}/jogl-demos-data.jar" /> - <property name="archive.name" value="jogl-demos-${jogl-demos.version}" /> + <property name="archive.name" value="jogl-demos-${jogl-demos.version}-${os.and.arch}" /> <property name="archive" value="${build}/${archive.name}" /> <property name="jogl.redbook.excludes" value="redbook/**" /> diff --git a/src/demos/gears/Gears.java b/src/demos/gears/Gears.java index 88de5c9..589ef8e 100644 --- a/src/demos/gears/Gears.java +++ b/src/demos/gears/Gears.java @@ -7,6 +7,7 @@ import com.jogamp.opengl.util.Animator; import com.jogamp.newt.event.*; import com.jogamp.newt.event.awt.*; +import java.awt.BorderLayout; import java.awt.Component; import java.awt.Frame; import com.jogamp.newt.Window; @@ -19,6 +20,9 @@ import com.jogamp.newt.Window; */ public class Gears implements GLEventListener { + static { + GLProfile.initSingleton(false); + } private float view_rotx = 20.0f, view_roty = 30.0f, view_rotz = 0.0f; private int gear1, gear2, gear3; private float angle = 0.0f; @@ -31,20 +35,13 @@ public class Gears implements GLEventListener { // <application-desc main-class="demos.j2d.TextCube"/> // <argument>NotFirstUIActionOnProcess</argument> // </application-desc> - boolean firstUIActionOnProcess = 0==args.length || !args[0].equals("NotFirstUIActionOnProcess") ; - GLProfile.initSingleton(firstUIActionOnProcess); + // boolean firstUIActionOnProcess = 0==args.length || !args[0].equals("NotFirstUIActionOnProcess") ; Frame frame = new Frame("Gear Demo"); - GLCanvas canvas = new GLCanvas(); - // GLCapabilities caps = new GLCapabilities(GLProfile.getDefault()); - // GLCanvas canvas = new GLCanvas(caps); - - final Gears gears = new Gears(); - canvas.addGLEventListener(gears); - - frame.add(canvas); frame.setSize(300, 300); - final Animator animator = new Animator(canvas); + frame.setLayout(new BorderLayout()); + + final Animator animator = new Animator(); frame.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { // Run this on another thread than the AWT event queue to @@ -58,6 +55,18 @@ public class Gears implements GLEventListener { }).start(); } }); + + GLCanvas canvas = new GLCanvas(); + animator.add(canvas); + // GLCapabilities caps = new GLCapabilities(GLProfile.getDefault()); + // GLCanvas canvas = new GLCanvas(caps); + + final Gears gears = new Gears(); + canvas.addGLEventListener(gears); + + frame.add(canvas, BorderLayout.CENTER); + frame.validate(); + frame.setVisible(true); animator.start(); } |