From 3f92d13a9f886b044f8f1c49ff22476e30ba408d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 19 Dec 2010 01:04:38 +0100 Subject: Unique ZIP archive name ; Gears main init sequence --- make/build.xml | 6 ++++-- 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 @@ + + @@ -89,7 +91,7 @@ - + @@ -125,7 +127,7 @@ - + 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 { // // NotFirstUIActionOnProcess // - 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(); } -- cgit v1.2.3