Announcement

Collapse
No announcement yet.

JOGL 2.0 refactorer, and NEWT support

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Omega
    started a topic JOGL 2.0 refactorer, and NEWT support

    JOGL 2.0 refactorer, and NEWT support

    Hi all,

    We've recently been looking at updating our UI for our main 3D data viewer, which is based on the WWJ SDK (see here for more information). One of the decisions we've made is that we're going to switch to JOGL 2.0, mainly because of the better performance and flexibility of the NEWT framework (native reparenting -> fullscreen switch without losing GLContext!).

    We also want to stay up-to-date with the latest features being built by the NASA WWJ team. As such, I created an automatic JOGL1->JOGL2 refactoring utility, based on the Eclipse JDT libraries, which can take the WWJ source code and update/refactor it to support JOGL2.

    I've tested the refactorer with both the 1.4 release and the latest code in the SVN repository. To run, download the utility, unzip to a directory, and run the batch file with the WWJ SDK directory as an argument:

    Code:
    refactorer.bat "C:\Downloads\worldwind-1.4.0"
    You then need to replace jogl.jar with jogl.all.jar from JOGL2, as well as updating gluegen-rt.jar, and all of the relevant binaries.

    I've also created a NEWT WorldWindow implementation which uses the NewtCanvasAWT as its superclass instead of the standard GLCanvas. You can find the required classes and an example in our git repository on the jogl2 branch here.

    Download the refactorer here: JOGL1->JOGL2 refactorer

    I'd love it if the NASA guys would consider upgrading the codebase to JOGL2. It would be a good start down the road of merging the Android and Desktop WWJ projects into a single codebase.

    Thanks,
    Michael

  • AqD
    replied
    just google WorldWindowNewtCanvas.java. There is a working implementation of WorldWindow on NEWT, with a new input handler which converts NEWT events to AWT events which other WWJ parts rely on. I have been using it and also created a version working directly on NEWT-SWT canvas.

    Leave a comment:


  • tag
    replied
    There's nothing in WW that uses NEWT.

    Leave a comment:


  • jonathanknez
    replied
    Just curious about the current state of affairs. I got the WW 2.0 daily build that uses JOGL 2.0. I am curious though, is there anything in there already that uses NEWT or do I need to go borrow Omega's code?

    Leave a comment:


  • arich57
    replied
    Originally posted by nlneilson View Post
    Some have had problems with java 1.7 on Mac.
    http://reviews.cnet.com/8301-13727_7...times-in-os-x/

    Does 1.7 run OK with other java apps with the Mac OS version you have?
    Yeah it's fine with everything else as far as I can tell. I'm hope the new jogl2 compatible version of WW will solve the problem.

    Leave a comment:


  • nlneilson
    replied
    Some have had problems with java 1.7 on Mac.
    http://reviews.cnet.com/8301-13727_7...times-in-os-x/

    Does 1.7 run OK with other java apps with the Mac OS version you have?

    Leave a comment:


  • arich57
    replied
    Originally posted by tag View Post
    We are finishing the port to JOGL2 and hope to have it available next week. Right now we're trying to work around some bugs in JOGL2. If you can wait, you'd be better off.
    That is perfect. I can wait.

    Let me know if you need a tester =)

    Thanks for the quick response.

    Leave a comment:


  • tag
    replied
    We are finishing the port to JOGL2 and hope to have it available next week. Right now we're trying to work around some bugs in JOGL2. If you can wait, you'd be better off.

    Leave a comment:


  • arich57
    replied
    I went ahead and tried to do the refactor. I'm obviously doing something wrong though because I'm getting lots of errors (100+) such as:

    [javac] /Users/xxx/Desktop/Worldwind/src/gov/nasa/worldwind/awt/WorldWindowGLCanvas.java:54: error: cannot find symbol
    [javac] public class WorldWindowGLCanvas extends GLCanvas implements WorldWindow, PropertyChangeListener

    When I look at the file and jars, I see the GLCanvas class is in:
    ./javax/media/opengl/awt/GLCanvas

    not:
    ./javax/media/opengl/GLCanvas. So the import isn't going to work.

    I know others have said the conversion tool worked for them so it's something I am doing (or not doing) correct.

    Could someone post the exact steps need to convert WWJ 1.4 to work with jogl 2.0?

    Thanks.

    -Aaron

    Leave a comment:


  • arich57
    replied
    Mac 1.7 support

    Hey all,

    I'm trying to get a existing world wind application to run on a Mac (previously only had to do Linux and Windows) and have hit a bug that I think this thread addresses/might be able to help.

    The application requires Java 1.7. Unfortunately, Mac 1.7 Java has a bug with jogl 1.1.1 (http://forum.worldwindcentral.com/sh...ad.php?t=33033). (tested with base examples. If I use 1.6_37, I can run the examples. 1.7_10, I can't. But I can't use 1.7 in my main app).

    I'm hoping switch to jogl 2.0 will fix this (where this thread comes in). My plan is to run the refactor on the 1.4 release using 2.0 jogl.

    My steps are:
    1) download 1.4 source
    2) dowload jogl-2.0 from: http://jogamp.org/deployment/jogamp-...l-platforms.7z
    3) replace wwj/jogl.jar with jogl-all.jar
    4) replace wwj/gluegen-rt.jar with gluegen-rt.jar
    5) replace ??? wwj/??? with updated version. (I believe I need to replace the jnilib/dll/.so's too. But which version do I use?)
    6) run factor tool

    I wanted to see:
    A) Has anyone already tried this?
    B) Does this make sense as a (hopeful) way around this bug?
    C) Am I missing any steps?
    D) Any other suggestions on how I can get World Wind working on a Mac with 1.7?

    Thanks in advance for any advice/direction. If there is a better place for me to post this please let me know.

    -Aaron
    Last edited by arich57; 01-08-2013, 12:02 AM.

    Leave a comment:


  • Omega
    replied
    Originally posted by maehlen View Post
    Omega - thanks so much for the refactoring code - it is a solution I can't live without.

    I've:
    1. Downloaded the current WWJ source code and made it an Eclipse project.
    2. Downloaded the current refactoring code from your github site and made it an Eclipse project
    3. Placed the gdal.jar and jogl.jar files from the WWJ distribution in to the refactoring Eclipse directory.
    4. Ran your refactoring code.
    5. Placed the current jogl.jar (called jogl-all.jar) into the WWJ source code project.

    The problem is that when I recompile the WWJ Eclipse project, I get ~600 GL2-class errors, such as the following:

    the line:
    gl.glMatrixMode(GL2.GL_MODELVIEW);
    causes the error message:
    "The field GL2.GL_MODELVIEW is ambiguous


    Any ideas?

    Thanks
    That's strange; have you removed the reference to the old JOGL from your build path?

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Originally posted by tag View Post
    We will be porting WW to use JOGL2 sometime in the next couple of months. Because there's no backwards compatibility in JOGL2, we'll have to make a major version of WW. Current plans are to have WW 2.0 be identical to WW 1.5 except for the JOGL difference. This will enable most apps to move without any changes. Apps that use JOGL will have to make the necessary changes. WW 2.0 and WW 1.5 will be released simultaneously.
    Thanks! Really need it, given the changes in Apple's Java 1.7 (now Oracle).

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Originally posted by Kashank View Post
    Thanks for yall's help, but I'm back again haha

    I'm throwing an error in this class

    https://github.com/ga-m3dv/ga-worldw...ewtCanvas.java

    in both constructors there's a call to super(GLWindow.create(getCaps()));

    I'm throwing an error that says "no suitable method found for create(GLCapabilites)"

    I'm not sure how to fix this error (seeing as I just copied the class)
    Omega - thanks so much for the refactoring code - it is a solution I can't live without.

    I've:
    1. Downloaded the current WWJ source code and made it an Eclipse project.
    2. Downloaded the current refactoring code from your github site and made it an Eclipse project
    3. Placed the gdal.jar and jogl.jar files from the WWJ distribution in to the refactoring Eclipse directory.
    4. Ran your refactoring code.
    5. Placed the current jogl.jar (called jogl-all.jar) into the WWJ source code project.

    The problem is that when I recompile the WWJ Eclipse project, I get ~600 GL2-class errors, such as the following:

    the line:
    gl.glMatrixMode(GL2.GL_MODELVIEW);
    causes the error message:
    "The field GL2.GL_MODELVIEW is ambiguous


    Any ideas?

    Thanks

    Leave a comment:


  • Omega
    replied
    That's a call on GLWindow (javadoc here). Are you using an older version of JOGL2? Or are you importing a different GLWindow?

    Leave a comment:


  • Kashank
    replied
    Thanks for yall's help, but I'm back again haha

    I'm throwing an error in this class

    https://github.com/ga-m3dv/ga-worldw...ewtCanvas.java

    in both constructors there's a call to super(GLWindow.create(getCaps()));

    I'm throwing an error that says "no suitable method found for create(GLCapabilites)"

    I'm not sure how to fix this error (seeing as I just copied the class)

    Leave a comment:

Working...
X