diff options
author | Kenneth Russel <[email protected]> | 2009-03-19 00:33:27 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2009-03-19 00:33:27 +0000 |
commit | 4433fd7343f1161a4def7152cff68d3fb8fcbb5d (patch) | |
tree | ca6b5beac19214147b2fc9e81b5cb98b4f9b7cbf /src/demos/misc | |
parent | aefbc0323da190835bc146709bf560b3e3181b39 (diff) |
Updated demos after refactoring of OpenGL capability bits back into GLCapabilities
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JOGL_2_SANDBOX@323 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/misc')
-rwxr-xr-x | src/demos/misc/GLCapsTableDemo.java | 43 | ||||
-rwxr-xr-x | src/demos/misc/Picking.java | 3 | ||||
-rwxr-xr-x | src/demos/misc/TiledRendering.java | 4 |
3 files changed, 26 insertions, 24 deletions
diff --git a/src/demos/misc/GLCapsTableDemo.java b/src/demos/misc/GLCapsTableDemo.java index 26599b4..44314fb 100755 --- a/src/demos/misc/GLCapsTableDemo.java +++ b/src/demos/misc/GLCapsTableDemo.java @@ -13,9 +13,10 @@ import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; -import javax.media.nwi.DefaultNWCapabilitiesChooser; -import javax.media.nwi.NWCapabilities; -import javax.media.nwi.NWCapabilitiesChooser; +import javax.media.nativewindow.Capabilities; +import javax.media.opengl.DefaultGLCapabilitiesChooser; +import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLCapabilitiesChooser; import javax.media.opengl.awt.GLCanvas; import com.sun.opengl.util.FPSAnimator; import javax.swing.BorderFactory; @@ -28,7 +29,7 @@ import javax.swing.JTable; /******************************************************************************* * @file GLCapsTableDemo.java - * @desc Demonstrate use of NWCapabilitiesChooser and DefaultNWCapabilities. + * @desc Demonstrate use of GLCapabilitiesChooser and DefaultGLCapabilities. * Demo tabulates the available capabilities array and put the data into a * table. Pressing respawn button displays a canvas created with the * currently selected index corresponding to the available array. There @@ -47,7 +48,7 @@ import javax.swing.JTable; public class GLCapsTableDemo extends JFrame implements - NWCapabilitiesChooser + GLCapabilitiesChooser { private String[] colNames = {"Pfd", "H/W", "DblBfr", "Stereo", // index, hwaccel, double, stereo @@ -55,7 +56,7 @@ public class GLCapsTableDemo "ABits", "aR", "aG", "aB", "aA", // accum bits "Z", "S", "AA|AAS", "PBuf(Float|RTT|RTTRec)"}; // depth, stencil, n // samples, pbuffer - private ArrayList/*<NWCapabilities>*/ available = new ArrayList/*<NWCapabilities>*/(); + private ArrayList/*<GLCapabilities>*/ available = new ArrayList/*<GLCapabilities>*/(); private ArrayList/*<Integer>*/ indices = new ArrayList/*<Integer>*/(); private Object[][] data; private JTable capsTable; @@ -63,18 +64,20 @@ public class GLCapsTableDemo private int selected = desiredCapIndex; protected JPanel pane, pane2; private boolean updateLR;// leftright - private DefaultNWCapabilitiesChooser choiceExaminer = // - new DefaultNWCapabilitiesChooser() + private DefaultGLCapabilitiesChooser choiceExaminer = // + new DefaultGLCapabilitiesChooser() { - public int chooseCapabilities(NWCapabilities desired, - NWCapabilities[] available, + public int chooseCapabilities(Capabilities _desired, + Capabilities[] _available, int windowSystemRecommendedChoice) { + GLCapabilities desired = (GLCapabilities) _desired; + GLCapabilities[] available = (GLCapabilities[]) _available; if ( available != null ) for (int i = 0; i < available.length; i++) { - NWCapabilities c = available[i]; + GLCapabilities c = available[i]; if (c != null) { - GLCapsTableDemo.this.available.add((NWCapabilities) c.clone()); + GLCapsTableDemo.this.available.add((GLCapabilities) c.clone()); GLCapsTableDemo.this.indices.add(new Integer(i)); } } @@ -109,7 +112,7 @@ public class GLCapsTableDemo private Dimension defdim = new Dimension(512, 256); private String visTip = "If no gears are visible, it may be that the " + "current desktop color resolution doesn't match " - + "the NWCapabilities chosen. Check CBits column."; + + "the GLCapabilities chosen. Check CBits column."; /** @@ -123,11 +126,11 @@ public class GLCapsTableDemo /** * (non-Javadoc) * - * @see javax.media.opengl.NWCapabilitiesChooser#chooseCapabilities(javax.media.opengl.NWCapabilities, - * javax.media.opengl.NWCapabilities[], int) + * @see javax.media.opengl.GLCapabilitiesChooser#chooseCapabilities(javax.media.nativewindow.Capabilities, + * javax.media.nativewindow.Capabilities[], int) */ - public int chooseCapabilities(NWCapabilities desired, - NWCapabilities[] available, + public int chooseCapabilities(Capabilities desired, + Capabilities[] available, int windowSystemRecommendedChoice) { int row = capsTable.getSelectedRow(); @@ -171,7 +174,7 @@ public class GLCapsTableDemo private void initComponents() { // Hack: use multisampled capabilities to pick up more detailed information on Windows - NWCapabilities multisampledCaps = new NWCapabilities(); + GLCapabilities multisampledCaps = new GLCapabilities(); multisampledCaps.setSampleBuffers(true); canvas = new GLCanvas(multisampledCaps, choiceExaminer, null, device); @@ -201,7 +204,7 @@ public class GLCapsTableDemo getContentPane().add(buildControls(), BorderLayout.NORTH); } - private JTable tabulateTable(ArrayList/*<NWCapabilities>*/ capabilities, + private JTable tabulateTable(ArrayList/*<GLCapabilities>*/ capabilities, ArrayList/*<Integer>*/ indices) { capabilities.trimToSize(); @@ -210,7 +213,7 @@ public class GLCapsTableDemo for (int pfd = 0; pfd < capabilities.size(); pfd++) { data[ pfd ][ 0 ] = indices.get(pfd); - NWCapabilities cap = (NWCapabilities) capabilities.get(pfd); + GLCapabilities cap = (GLCapabilities) capabilities.get(pfd); data[ pfd ][ 1 ] = "" + (cap.getHardwareAccelerated() ? f : f); data[ pfd ][ 2 ] = "" + (cap.getDoubleBuffered() ? t : f); data[ pfd ][ 3 ] = "" + (cap.getStereo() ? t : f); diff --git a/src/demos/misc/Picking.java b/src/demos/misc/Picking.java index 1c05178..6f95251 100755 --- a/src/demos/misc/Picking.java +++ b/src/demos/misc/Picking.java @@ -14,7 +14,6 @@ import java.awt.*; import java.awt.event.*; import java.awt.Canvas.*; import java.nio.*; -import javax.media.nwi.*; import javax.media.opengl.*; import javax.media.opengl.awt.GLCanvas; import javax.media.opengl.glu.*; @@ -32,7 +31,7 @@ public class Picking { Frame frame = new Frame("Picking Example"); GLDrawableFactory factory = GLDrawableFactory.getFactory(); - NWCapabilities capabilities = new NWCapabilities(); + GLCapabilities capabilities = new GLCapabilities(); GLCanvas drawable = new GLCanvas(capabilities); final Renderer renderer = new Renderer(); drawable.addGLEventListener(renderer); diff --git a/src/demos/misc/TiledRendering.java b/src/demos/misc/TiledRendering.java index db3b8e9..b218b01 100755 --- a/src/demos/misc/TiledRendering.java +++ b/src/demos/misc/TiledRendering.java @@ -15,7 +15,7 @@ import javax.imageio.ImageIO; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; -import javax.media.nwi.NWCapabilities; +import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLContext; import javax.media.opengl.GLDrawableFactory; import javax.media.opengl.GLPbuffer; @@ -44,7 +44,7 @@ public class TiledRendering { } // Use a pbuffer for rendering - NWCapabilities caps = new NWCapabilities(); + GLCapabilities caps = new GLCapabilities(); caps.setDoubleBuffered(false); GLPbuffer pbuffer = GLDrawableFactory.getFactory().createGLPbuffer(caps, null, 256, 256, |