diff options
author | Kenneth Russel <[email protected]> | 2003-07-15 22:32:06 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2003-07-15 22:32:06 +0000 |
commit | beaca5fa8a64e8b7c5e9452fa9828eb9a217bd2e (patch) | |
tree | b9b6ac76a155de85f6b2d2ab0b29686c55ec510d /src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java | |
parent | ecb910404a7ba50afa71b3bf18689dc80d8008a5 (diff) |
Fixed bug in Animator where it would hang upon stopping if exception
was thrown during init(). Fixed build.xml files to get javac to
produce source file and line number information. Fixed demos to pop up
a dialog box if an extension they need is unsupported.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@12 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java')
-rw-r--r-- | src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java index 5eb5614..e917ca2 100644 --- a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java +++ b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java @@ -40,6 +40,7 @@ import java.io.*; import java.nio.*; import java.util.*; import javax.imageio.*; +import javax.swing.*; import net.java.games.jogl.*; import net.java.games.jogl.util.*; @@ -158,34 +159,36 @@ public class HWShadowmapsSimple { } }); - while (!quit) { - if (viewer != null) { - viewer.update(); - - // Grab these values once per render to avoid multithreading - // issues with their values being changed by manipulation from - // the AWT thread during the render - CameraParameters params = viewer.getCameraParameters(); - - cameraPerspective.set(params.getProjectionMatrix()); - cameraInverseTransform.set(params.getModelviewMatrix()); - cameraTransform.set(cameraInverseTransform); - cameraTransform.invertRigid(); - spotlightTransform.set(spotlight.getTransform()); - spotlightInverseTransform.set(spotlightTransform); - spotlightInverseTransform.invertRigid(); - objectTransform.set(object.getTransform()); - } + try { + while (!quit) { + if (viewer != null) { + viewer.update(); + + // Grab these values once per render to avoid multithreading + // issues with their values being changed by manipulation from + // the AWT thread during the render + CameraParameters params = viewer.getCameraParameters(); + + cameraPerspective.set(params.getProjectionMatrix()); + cameraInverseTransform.set(params.getModelviewMatrix()); + cameraTransform.set(cameraInverseTransform); + cameraTransform.invertRigid(); + spotlightTransform.set(spotlight.getTransform()); + spotlightInverseTransform.set(spotlightTransform); + spotlightInverseTransform.invertRigid(); + objectTransform.set(object.getTransform()); + } - if (displayMode == RENDER_SCENE_FROM_CAMERA_VIEW_SHADOWED || !fullyInitialized) { - if (pbuffer != null) { - pbuffer.display(); + if (displayMode == RENDER_SCENE_FROM_CAMERA_VIEW_SHADOWED || !fullyInitialized) { + if (pbuffer != null) { + pbuffer.display(); + } } + canvas.display(); } - canvas.display(); + } finally { + System.exit(0); } - - System.exit(0); } //---------------------------------------------------------------------- @@ -372,7 +375,9 @@ public class HWShadowmapsSimple { private void checkExtension(GL gl, String extensionName) { if (!gl.isExtensionAvailable(extensionName)) { - throw new GLException("Unable to initialize " + extensionName + " OpenGL extension"); + String message = "Unable to initialize " + extensionName + " OpenGL extension"; + JOptionPane.showMessageDialog(null, message, "Unavailable extension", JOptionPane.ERROR_MESSAGE); + throw new GLException(message); } } |