diff options
author | Kenneth Russel <[email protected]> | 2005-08-17 21:41:40 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-08-17 21:41:40 +0000 |
commit | bdc9c5f4d9a9a428538a402c1248b4502415e6a6 (patch) | |
tree | 864f30d8b5fa820dacd473c4e68f2bc843dc6141 /src/demos/jrefract | |
parent | f7ab90c440fdd90deb9afe67b7e6707407b675be (diff) |
Revised JGears demo to add FPS counter and logos drawn with Java2D and
changed JRefract and JGearsFullscreen demos to use JGears instead.
Fixed bugs in fullscreen demos where workarounds were lost during last
refactoring; created new FullscreenWorkaround GLEventListener which
implements the workaround.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@114 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/jrefract')
-rwxr-xr-x | src/demos/jrefract/JRefract.java | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/demos/jrefract/JRefract.java b/src/demos/jrefract/JRefract.java index 5b8e4c1..ac9c93a 100755 --- a/src/demos/jrefract/JRefract.java +++ b/src/demos/jrefract/JRefract.java @@ -46,10 +46,10 @@ import javax.swing.event.*; import net.java.games.jogl.*; import net.java.games.jogl.util.*; -import demos.gears.Gears; import demos.hdr.HDR; import demos.hwShadowmapsSimple.HWShadowmapsSimple; import demos.infiniteShadowVolumes.InfiniteShadowVolumes; +import demos.jgears.JGears; import demos.proceduralTexturePhysics.ProceduralTexturePhysics; import demos.util.*; import demos.vertexBufferObject.VertexBufferObject; @@ -104,13 +104,13 @@ public class JRefract { inner.setVisible(true); GLCapabilities caps = new GLCapabilities(); - if (which == GEARS) { - caps.setAlphaBits(8); - } if (which == INFINITE) { caps.setStencilBits(16); } - final GLJPanel canvas = GLDrawableFactory.getFactory().createGLJPanel(caps); + final GLJPanel canvas = + (which == GEARS) ? + new JGears() : + GLDrawableFactory.getFactory().createGLJPanel(caps); final DemoListener demoListener = new DemoListener() { public void shutdownDemo() { removeJPanel(canvas); @@ -128,7 +128,7 @@ public class JRefract { switch (which) { case GEARS: { - canvas.addGLEventListener(new Gears()); + // GLEventListener already added break; } @@ -217,14 +217,7 @@ public class JRefract { } else if (which == GEARS) { // Provide control over transparency of gears background canvas.setOpaque(false); - JPanel gradientPanel = new JPanel() { - public void paintComponent(Graphics g) { - ((Graphics2D) g).setPaint(new GradientPaint(0, 0, Color.WHITE, - getWidth(), getHeight(), Color.DARK_GRAY)); - g.fillRect(0, 0, getWidth(), getHeight()); - } - }; - gradientPanel.setLayout(new BorderLayout()); + JPanel gradientPanel = JGears.createGradientPanel(); inner.getContentPane().add(gradientPanel, BorderLayout.CENTER); gradientPanel.add(canvas, BorderLayout.CENTER); |