From beaca5fa8a64e8b7c5e9452fa9828eb9a217bd2e Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Tue, 15 Jul 2003 22:32:06 +0000 Subject: 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 --- src/demos/vertexProgRefract/VertexProgRefract.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/demos/vertexProgRefract') diff --git a/src/demos/vertexProgRefract/VertexProgRefract.java b/src/demos/vertexProgRefract/VertexProgRefract.java index 34ed174..c14f204 100644 --- a/src/demos/vertexProgRefract/VertexProgRefract.java +++ b/src/demos/vertexProgRefract/VertexProgRefract.java @@ -41,6 +41,7 @@ import java.nio.*; import java.util.*; import javax.imageio.*; import javax.imageio.stream.*; +import javax.swing.*; import net.java.games.jogl.*; import net.java.games.jogl.util.*; @@ -229,7 +230,7 @@ public class VertexProgRefract { initExtension(gl, "GL_NV_register_combiners"); initExtension(gl, "GL_ARB_multitexture"); } catch (RuntimeException e) { - runExit(); + quit = true; throw(e); } @@ -510,7 +511,14 @@ public class VertexProgRefract { private void initExtension(GL gl, String glExtensionName) { if (!gl.isExtensionAvailable(glExtensionName)) { - throw new RuntimeException("OpenGL extension \"" + glExtensionName + "\" not available"); + final String message = "OpenGL extension \"" + glExtensionName + "\" not available"; + new Thread(new Runnable() { + public void run() { + JOptionPane.showMessageDialog(null, message, "Unavailable extension", JOptionPane.ERROR_MESSAGE); + runExit(); + } + }).start(); + throw new RuntimeException(message); } } -- cgit v1.2.3