Unregistered
05-27-2007, 07:35 AM
Hello,
I recently downloaded the WW SDK only to hit a couple of snags. I'm not sure if it's WW, JOGL, or even my reference system. So if anyone has run into the same snags or a work-around; it would be appreciated.
Here's what I'm running:
MacOSX (Intel) 10.4.9
Java 1.5.0_07
JOGL (Stable) 1.1.0
As a note I haven't tried running on Solaris, Windows, or Linux.
Here's the code:
import gov.nasa.worldwind.AVKey;
import gov.nasa.worldwind.Layer;
import gov.nasa.worldwind.LayerList;
import gov.nasa.worldwind.Model;
import gov.nasa.worldwind.WorldWind;
import gov.nasa.worldwind.awt.WorldWindowGLCanv as;
import gov.nasa.worldwind.awt.WorldWindowGLJPan el;
import gov.nasa.worldwind.layers.CompassLayer;
import gov.nasa.worldwind.layers.Earth.BMNGSurf aceLayer;
import gov.nasa.worldwind.layers.Earth.EarthNAS APlaceNameLayer;
import gov.nasa.worldwind.layers.Earth.LandsatI 3;
import gov.nasa.worldwind.layers.Earth.USGSUrba nAreaOrtho;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class wwtest {
// private WorldWindowGLJPanel wwp = new WorldWindowGLJPanel(); //1
private WorldWindowGLCanvas wwp = new WorldWindowGLCanvas();
public void ww() {
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_O N_CLOSE);
f.add(wwp, BorderLayout.CENTER);
Model m = (Model) WorldWind.createConfigurationComponent(A VKey.MODEL_CLASS_NAME);
m.setLayers(new LayerList(new Layer[] {
new BMNGSurfaceLayer(),
new LandsatI3(),
new USGSUrbanAreaOrtho(),
new EarthNASAPlaceNameLayer(),
new CompassLayer("Compass.png")})); //2
wwp.setModel(m);
f.setVisible(true);
}
public static void main(String[] args) {
final wwtest wwt = new wwtest();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
wwt.ww();
}
});
}
}
Snag 1 (see comment //1):
If I switch to a WorldWindGLJPanel the following exception is thrown:
Exception in thread "main" gov.nasa.worldwind.WWRuntimeException: Unable to create WorldWindow
at gov.nasa.worldwind.awt.WorldWindowGLJPan el.<init>(WorldWindowGLJPanel.java:34)
at wwtest.<init>(wwtest.java:21)
at wwtest.main(wwtest.java:43)
Caused by: java.lang.NullPointerException
at javax.media.opengl.GLJPanel.setAutoSwapB ufferMode(GLJPanel.java:791)
at gov.nasa.worldwind.WorldWindowGLAutoDraw able.<init>(WorldWindowGLAutoDrawable.java:43)
at gov.nasa.worldwind.awt.WorldWindowGLJPan el.<init>(WorldWindowGLJPanel.java:26)
... 2 more
FYI: I was able to bypass the exception; however, this exception is thrown in the official SDK release of WW (no code changes).
Snag 2 (see comment //2):
If I use the non-default constructor for CompassLayer, and pass in another PNG image the WW canvas begins to flicker when the mouse is moved into the component. Also, I should mention the PNG image is loaded; however, it's visibly scaled smaller than it's actual pixel size.
Anyway, if anyone as an idea as to what's causing the problems or any other ideas; then drop a reply thread.
Thanks,
jeremy
I recently downloaded the WW SDK only to hit a couple of snags. I'm not sure if it's WW, JOGL, or even my reference system. So if anyone has run into the same snags or a work-around; it would be appreciated.
Here's what I'm running:
MacOSX (Intel) 10.4.9
Java 1.5.0_07
JOGL (Stable) 1.1.0
As a note I haven't tried running on Solaris, Windows, or Linux.
Here's the code:
import gov.nasa.worldwind.AVKey;
import gov.nasa.worldwind.Layer;
import gov.nasa.worldwind.LayerList;
import gov.nasa.worldwind.Model;
import gov.nasa.worldwind.WorldWind;
import gov.nasa.worldwind.awt.WorldWindowGLCanv as;
import gov.nasa.worldwind.awt.WorldWindowGLJPan el;
import gov.nasa.worldwind.layers.CompassLayer;
import gov.nasa.worldwind.layers.Earth.BMNGSurf aceLayer;
import gov.nasa.worldwind.layers.Earth.EarthNAS APlaceNameLayer;
import gov.nasa.worldwind.layers.Earth.LandsatI 3;
import gov.nasa.worldwind.layers.Earth.USGSUrba nAreaOrtho;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class wwtest {
// private WorldWindowGLJPanel wwp = new WorldWindowGLJPanel(); //1
private WorldWindowGLCanvas wwp = new WorldWindowGLCanvas();
public void ww() {
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_O N_CLOSE);
f.add(wwp, BorderLayout.CENTER);
Model m = (Model) WorldWind.createConfigurationComponent(A VKey.MODEL_CLASS_NAME);
m.setLayers(new LayerList(new Layer[] {
new BMNGSurfaceLayer(),
new LandsatI3(),
new USGSUrbanAreaOrtho(),
new EarthNASAPlaceNameLayer(),
new CompassLayer("Compass.png")})); //2
wwp.setModel(m);
f.setVisible(true);
}
public static void main(String[] args) {
final wwtest wwt = new wwtest();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
wwt.ww();
}
});
}
}
Snag 1 (see comment //1):
If I switch to a WorldWindGLJPanel the following exception is thrown:
Exception in thread "main" gov.nasa.worldwind.WWRuntimeException: Unable to create WorldWindow
at gov.nasa.worldwind.awt.WorldWindowGLJPan el.<init>(WorldWindowGLJPanel.java:34)
at wwtest.<init>(wwtest.java:21)
at wwtest.main(wwtest.java:43)
Caused by: java.lang.NullPointerException
at javax.media.opengl.GLJPanel.setAutoSwapB ufferMode(GLJPanel.java:791)
at gov.nasa.worldwind.WorldWindowGLAutoDraw able.<init>(WorldWindowGLAutoDrawable.java:43)
at gov.nasa.worldwind.awt.WorldWindowGLJPan el.<init>(WorldWindowGLJPanel.java:26)
... 2 more
FYI: I was able to bypass the exception; however, this exception is thrown in the official SDK release of WW (no code changes).
Snag 2 (see comment //2):
If I use the non-default constructor for CompassLayer, and pass in another PNG image the WW canvas begins to flicker when the mouse is moved into the component. Also, I should mention the PNG image is loaded; however, it's visibly scaled smaller than it's actual pixel size.
Anyway, if anyone as an idea as to what's causing the problems or any other ideas; then drop a reply thread.
Thanks,
jeremy