No Window opens when using GLCanvas

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

No Window opens when using GLCanvas

FieryToken
This post was updated on .
So i am experiencing a weird problem currently. I want to use WorldWind in my Java application but when i want to create a WorldWindowGLCanvas the thread with which i want to create it just "freezes" and does nothing. It throws no error message or anything that could give a clue to what the problem is. There is just no window opening. I also tried one of my older OpenGL Projects that use a GLCanvas and the same problem happens there. No window opens up but it worked before.
If i comment the creation of the GLCanvas or WorldWindowGLCanvas out and just start the JFrame i see the JFrame. So i guess it must have something to do with OpenGL.
Some Info
My IDE is: IntelliJ Ultimate
Graphics Card is: Intel HD graphics 520(newest driver installed)
Jogl version is: 2.3.2

Maybe someone experienced something simillar and can help me ^^? If i missed some info that you may need feel free to ask for it.

Code:

import gov.nasa.worldwind.BasicModel;
import gov.nasa.worldwind.WorldWindowGLDrawable;
import gov.nasa.worldwind.avlist.AVKey;
import gov.nasa.worldwind.awt.WorldWindowGLCanvas;
import gov.nasa.worldwind.globes.Earth;
import gov.nasa.worldwind.layers.IconLayer;
import gov.nasa.worldwind.layers.RenderableLayer;
import gov.nasa.worldwind.render.Renderable;
import gov.nasa.worldwind.util.WWUtil;

import javax.swing.*;
import java.awt.*;

public class ViewVolume extends JFrame {

    //CustomClass responsible for rendering the Globe and Layers
    protected WWPanel wwp;

    //Displays all the Layers and enables them to be turned on and off
    protected LayerPanel layerPanel;

    //Layer to display the CityIcons
    protected IconLayer iconLayer;

    //Renderable Layer for PointClouds
    protected RenderableLayer renderableLayer;

    public ViewVolume(){
        this.getContentPane().setLayout(new BorderLayout(5,5));
        this.wwp = new WWPanel(new Dimension(650,500));
        this.getContentPane().add(wwp);

        this.pack();
        this.setResizable(true);
        WWUtil.alignComponent(null,this, AVKey.CENTER);

        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //Adding the LayerPanel to toggle different Layers on and off
        layerPanel = new LayerPanel(wwp.wwd);
        //this.getContentPane().add(this.layerPanel, BorderLayout.WEST);
    }

    protected static class WWPanel extends JPanel {
        WorldWindowGLCanvas wwd;
        public WWPanel(Dimension size){
            //Create a WorldWindowGlCanvas -> needed to display the Globe, Layers etc.
            this.wwd = new WorldWindowGLCanvas();     //<- If i comment this out(and everything related to it) i can see the JFrame)
            //set the Window size
            this.wwd.setSize(size);

            //Create a BasicModel with earth as its Globe
            BasicModel bm = new BasicModel();
            bm.setGlobe(new Earth());

            //assign the Model to the WorldWindowGlCanvas
            this.wwd.setModel(bm);

            //add a BorderLayout to this JPanel
            this.setLayout(new BorderLayout(5,5));

            //add the WorldWindowGlCanvas to this JPanel centered
            this.add(this.wwd, BorderLayout.CENTER);

        }
    }

    public static void main(String[] args){
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                ViewVolume vv = new ViewVolume();
                vv.setVisible(true);
            }
        });
    }
}
Reply | Threaded
Open this post in threaded view
|

Re: No Window opens when using GLCanvas

gouessej
Administrator
Reply | Threaded
Open this post in threaded view
|

Re: No Window opens when using GLCanvas

FieryToken
Ok thanks for the answer. I tried the example in two projects. Once in the Project where the code i posted before is in and then in another project. It worked in the other Project but not in the first one. I tried to find something that is different between these two projects but i couldnt find anything, they should be the same.
Reply | Threaded
Open this post in threaded view
|

Re: No Window opens when using GLCanvas

gouessej
Administrator
I'm sad to say that but you should clean up your mess in this case. Look at your classpath, ensure that you use the correct version of JOGL and GlueGen, look at the version of JOGL required by Worldwind. Please use Worldwind 2.2.0 with JOGL 2.4 RC.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: No Window opens when using GLCanvas

FieryToken
Ok so one last thing i see now:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary$3 (file:/C:/Users/reck_st/Projekte/3DTilesImplGradle/libs/gluegen-rt.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String)
WARNING: Please consider reporting this to the maintainers of com.jogamp.common.os.NativeLibrary$3
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
An illegal reflective access operation has occurred

Illegal reflective access by com.jogamp.common.os.NativeLibrary$3 (file:/C:/Users/my_name/projects/myprojectname/libs/gluegen-rt.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String)

Please consider reporting this to the maintainers of com.jogamp.common.os.NativeLibrary$3

what does this mean? Could this cause my problem?

Reply | Threaded
Open this post in threaded view
|

Re: No Window opens when using GLCanvas

Sven Gothel
Administrator
On 1/12/21 10:31 AM, FieryToken [via jogamp] wrote:

> Ok so one last thing i see now:
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary$3
> (file:/C:/Users/reck_st/Projekte/3DTilesImplGradle/libs/gluegen-rt.jar) to
> method java.lang.ClassLoader.findLibrary(java.lang.String)
> WARNING: Please consider reporting this to the maintainers of
> com.jogamp.common.os.NativeLibrary$3
> WARNING: Use --illegal-access=warn to enable warnings of further illegal
> reflective access operations
> WARNING: All illegal access operations will be denied in a future release
> An illegal reflective access operation has occurred
>
> Illegal reflective access by com.jogamp.common.os.NativeLibrary$3
> (file:/C:/Users/my_name/Projekte/3DTilesImplGradle/libs/gluegen-rt.jar) to
> method java.lang.ClassLoader.findLibrary(java.lang.String)
>
> Please consider reporting this to the maintainers of
> com.jogamp.common.os.NativeLibrary$3
>
> what does this mean? Could this cause my problem?
Not an issue - as long the API allows it.
(Some 'private' module loading issues.
 Julien has a recipe for this)

With current build, I don't see this on the command line,
when launched from OpenJDK >= 11.
We actually swallow these messages with our own
'error message override', as far as I can remember
- added about a year ago.

This would be a good task for the (new) person,
willing to handle the 'JogAmp Packaging'.
(Meaning whoever likes to do things, go ahead)


~Sven


signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: No Window opens when using GLCanvas

Sven Gothel
Administrator
On 1/12/21 12:43 PM, Sven Gothel [via jogamp] wrote:
>>
>> what does this mean? Could this cause my problem?
> Not an issue - as long the API allows it.
> (Some 'private' module loading issues.
>  Julien has a recipe for this)


"A more recent version of Java3D is mentioned in my tutorial:
http://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/
"

There it is :)

~Sven


signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: No Window opens when using GLCanvas

FieryToken
Ok thank you for the answer. I will look more into it then ^^;
Reply | Threaded
Open this post in threaded view
|

Re: No Window opens when using GLCanvas

gouessej
Administrator
You're welcome. Sven is right, I mentioned some of the recipe in the article about Java 3D and some other options in the article about OpenJFX + JOGL.
Julien Gouesse | Personal blog | Website