home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2004 May / SGI IRIX 6.5 Applications 2004 May.iso / dist / java3d.idb / usr / demos / java / j3d / programs / examples / PackageInfo / QueryProperties.java.z / QueryProperties.java
Encoding:
Java Source  |  2003-08-08  |  5.3 KB  |  128 lines

  1. /*
  2.  *    @(#)QueryProperties.java 1.11 02/05/29 16:06:47
  3.  *
  4.  * Copyright (c) 1996-2002 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Redistribution and use in source and binary forms, with or without
  7.  * modification, are permitted provided that the following conditions
  8.  * are met:
  9.  *
  10.  * - Redistributions of source code must retain the above copyright
  11.  *   notice, this list of conditions and the following disclaimer.
  12.  *
  13.  * - Redistribution in binary form must reproduce the above copyright
  14.  *   notice, this list of conditions and the following disclaimer in
  15.  *   the documentation and/or other materials provided with the
  16.  *   distribution.
  17.  *
  18.  * Neither the name of Sun Microsystems, Inc. or the names of
  19.  * contributors may be used to endorse or promote products derived
  20.  * from this software without specific prior written permission.
  21.  *
  22.  * This software is provided "AS IS," without a warranty of any
  23.  * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
  24.  * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
  25.  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
  26.  * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
  27.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  28.  * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
  29.  * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
  30.  * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
  31.  * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
  32.  * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE,
  33.  * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  34.  *
  35.  * You acknowledge that Software is not designed,licensed or intended
  36.  * for use in the design, construction, operation or maintenance of
  37.  * any nuclear facility.
  38.  */
  39.  
  40. import java.util.Map;
  41. import javax.media.j3d.*;
  42. import java.awt.GraphicsEnvironment;
  43. import java.awt.GraphicsConfiguration;
  44. import com.sun.j3d.utils.universe.*;
  45.  
  46. public class QueryProperties {
  47.     public static void main(String[] args) {
  48.         VirtualUniverse vu = new VirtualUniverse();
  49.     Map vuMap = vu.getProperties();
  50.  
  51.     System.out.println("version = " +
  52.                vuMap.get("j3d.version"));
  53.     System.out.println("vendor = " +
  54.                vuMap.get("j3d.vendor"));
  55.     System.out.println("specification.version = " +
  56.                vuMap.get("j3d.specification.version"));
  57.     System.out.println("specification.vendor = " +
  58.                vuMap.get("j3d.specification.vendor"));
  59.     System.out.println("renderer = " +
  60.                vuMap.get("j3d.renderer") + "\n");
  61.  
  62.     GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
  63.  
  64.     /* We need to set this to force choosing a pixel format
  65.        that support the canvas.
  66.     */
  67.     template.setStereo(template.PREFERRED);
  68.     template.setSceneAntialiasing(template.PREFERRED);
  69.  
  70.         GraphicsConfiguration config =
  71.         GraphicsEnvironment.getLocalGraphicsEnvironment().
  72.                 getDefaultScreenDevice().getBestConfiguration(template);
  73.  
  74.     Map c3dMap = new Canvas3D(config).queryProperties();
  75.  
  76.     System.out.println("Renderer version = " +
  77.                c3dMap.get("native.version"));
  78.     System.out.println("doubleBufferAvailable = " +
  79.                c3dMap.get("doubleBufferAvailable"));
  80.     System.out.println("stereoAvailable = " +
  81.                c3dMap.get("stereoAvailable"));
  82.     System.out.println("sceneAntialiasingAvailable = " +
  83.                c3dMap.get("sceneAntialiasingAvailable"));
  84.     System.out.println("sceneAntialiasingNumPasses = " +
  85.                c3dMap.get("sceneAntialiasingNumPasses"));
  86.     System.out.println("textureColorTableSize = " +
  87.                c3dMap.get("textureColorTableSize"));
  88.     System.out.println("textureEnvCombineAvailable = " +
  89.                c3dMap.get("textureEnvCombineAvailable"));
  90.     System.out.println("textureCombineDot3Available = " +
  91.                c3dMap.get("textureCombineDot3Available"));
  92.     System.out.println("textureCombineSubtractAvailable = " +
  93.                c3dMap.get("textureCombineSubtractAvailable"));
  94.     System.out.println("texture3DAvailable = " +
  95.                c3dMap.get("texture3DAvailable"));
  96.     System.out.println("textureCubeMapAvailable = " +
  97.                c3dMap.get("textureCubeMapAvailable"));
  98.     System.out.println("textureSharpenAvailable = " +
  99.                c3dMap.get("textureSharpenAvailable"));
  100.     System.out.println("textureDetailAvailable = " +
  101.                c3dMap.get("textureDetailAvailable"));
  102.     System.out.println("textureFilter4Available = " +
  103.                c3dMap.get("textureFilter4Available"));
  104.     System.out.println("textureAnisotropicFilterDegreeMax = " +
  105.                c3dMap.get("textureAnisotropicFilterDegreeMax"));
  106.     System.out.println("textureBoundaryWidthMax = " +
  107.                c3dMap.get("textureBoundaryWidthMax"));
  108.     System.out.println("textureWidthMax = " +
  109.                c3dMap.get("textureWidthMax"));
  110.     System.out.println("textureHeightMax = " +
  111.                c3dMap.get("textureHeightMax"));
  112.     System.out.println("textureLodOffsetAvailable = " +
  113.                c3dMap.get("textureLodOffsetAvailable"));
  114.     System.out.println("textureLodRangeAvailable = " +
  115.                c3dMap.get("textureLodRangeAvailable"));
  116.     System.out.println("textureUnitStateMax = " +
  117.                c3dMap.get("textureUnitStateMax"));
  118.     System.out.println("compressedGeometry.majorVersionNumber = " +
  119.                c3dMap.get("compressedGeometry.majorVersionNumber"));
  120.     System.out.println("compressedGeometry.minorVersionNumber = " +
  121.                c3dMap.get("compressedGeometry.minorVersionNumber"));
  122.     System.out.println("compressedGeometry.minorMinorVersionNumber = " +
  123.         c3dMap.get("compressedGeometry.minorMinorVersionNumber"));
  124.  
  125.     System.exit(0);
  126.     }
  127. }
  128.