From f3405ce88d38b326a97f9cde53283b88334007eb Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sun, 7 Jan 2007 01:40:20 +0000 Subject: Added new FlyingText demo to illustrate more advanced usage of the TextRenderer class; displays dynamically rotated, translated and colored text. Changed how setSmoothing() is handled by the TextureRenderer and stopped disabling smoothing in the TextRenderer. For the time being, not exposing this flag in that class to keep the API simple. Changed TextRenderer to also push/pop the texture matrix. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@199 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4 --- src/demos/jrefract/JRefract.java | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/demos/jrefract') diff --git a/src/demos/jrefract/JRefract.java b/src/demos/jrefract/JRefract.java index 0a06f13..ee659da 100755 --- a/src/demos/jrefract/JRefract.java +++ b/src/demos/jrefract/JRefract.java @@ -46,6 +46,7 @@ import demos.common.*; import demos.hdr.HDR; import demos.hwShadowmapsSimple.HWShadowmapsSimple; import demos.infiniteShadowVolumes.InfiniteShadowVolumes; +import demos.j2d.FlyingText; import demos.jgears.JGears; import demos.proceduralTexturePhysics.ProceduralTexturePhysics; import demos.util.*; @@ -82,9 +83,10 @@ public class JRefract { private static final int HWSHADOWS = 3; private static final int INFINITE = 4; private static final int REFRACT = 5; - private static final int VBO = 6; - private static final int WARP = 7; - private static final int WATER = 8; + private static final int TEXT = 6; + private static final int VBO = 7; + private static final int WARP = 8; + private static final int WATER = 9; private JInternalFrame addWindow(int which) { // FIXME: workaround for problem in 1.6 where ALL Components, @@ -105,6 +107,7 @@ public class JRefract { case HWSHADOWS: str = "ARB_shadow Shadows"; break; case INFINITE: str = "Infinite Shadow Volumes"; break; case REFRACT: str = "Refraction Using Vertex Programs"; break; + case TEXT: str = "Flying Text"; break; case VBO: str = "Very Simple vertex_buffer_object demo"; break; case WATER: str = "Procedural Texture Waves"; break; } @@ -165,6 +168,11 @@ public class JRefract { break; } + case TEXT: { + demo = new FlyingText(); + break; + } + case VBO: { demo = new VertexBufferObject(); break; @@ -232,6 +240,10 @@ public class JRefract { } }); inner.getContentPane().add(checkBox, BorderLayout.SOUTH); + } else if (which == TEXT) { + FlyingText text = (FlyingText) demo; + inner.getContentPane().add(text.buildGUI(), BorderLayout.NORTH); + inner.getContentPane().add(canvas, BorderLayout.CENTER); } else { inner.getContentPane().add(canvas, BorderLayout.CENTER); } @@ -312,6 +324,14 @@ public class JRefract { }); menu.add(item); + item = new JMenuItem("Text"); + item.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + addWindow(TEXT); + } + }); + menu.add(item); + item = new JMenuItem("Vertex Buffer Object"); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { -- cgit v1.2.3