summaryrefslogtreecommitdiffstats
path: root/src/demos/jrefract/JRefract.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2007-01-07 01:40:20 +0000
committerKenneth Russel <[email protected]>2007-01-07 01:40:20 +0000
commitf3405ce88d38b326a97f9cde53283b88334007eb (patch)
treecf3f7d73bf48cf7255cff195069627eb55402f66 /src/demos/jrefract/JRefract.java
parent2b34526dd5c5274d14862f23b81f79dc7fbbe469 (diff)
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
Diffstat (limited to 'src/demos/jrefract/JRefract.java')
-rwxr-xr-xsrc/demos/jrefract/JRefract.java26
1 files changed, 23 insertions, 3 deletions
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) {