White screen from command line

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

White screen from command line

Robert
Hi,

I been trying to get my fullscreen JOGL and Java3D applications to to work from Eclipse, but I found they would come up as a white screen, but run fine if windowed. They also run fine from JCreator, which is what I used to develop them. Then I tried just running one of the tutorials (JOGL2Nehe05Shape3D.java) from the command line and I get the same problem. The screen is white, but if you alt+tab, minimize, and bring it up again it shows fine for a split second, then goes white again. The code however runs fine fullscreen from a bash shell in Ubuntu (and from JCreator in windows).

HP Pavillion dv2500
Vista 32bit
GeForce 7150
Reply | Threaded
Open this post in threaded view
|

Re: White screen from command line

Robert
I forgot to mention that I modified the example code mentioned so that it would run fullscreen:

code added for fullscreen:

            GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();

            boolean isFullScreen = device.isFullScreenSupported();
            frame.setUndecorated(isFullScreen);
            frame.setResizable(!isFullScreen);
            if (isFullScreen)
            {
            System.out.println("full screen");
                // Full-screen mode
                device.setFullScreenWindow(frame);
                frame.validate();
            } else
            {
            System.out.println("windowed");

            // Windowed mode
            frame.setSize(900,600);
            frame.setLocationRelativeTo(null);

                frame.pack();
                frame.setVisible(true);
                frame.setTitle(TITLE);
            }
Reply | Threaded
Open this post in threaded view
|

Re: White screen from command line

gouessej
Administrator
In reply to this post by Robert
Hi

Please can you try to use the full screen mode of AWT in an application not using JOGL? I would like to know whether the problem comes from GLCanvas or AWT itself.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: White screen from command line

Robert
Yup, same problem with a Java3D program that uses a JFrame fullscreen.
Reply | Threaded
Open this post in threaded view
|

Re: White screen from command line

Robert
I've tried with adding Java3D's Canvas3D to a JPanel, and likewise with adding a GLCanvas to a JPanel. In both cases the JPanel is added to the JFrame. I've further tried placing that JPanel inside another JPanel and it makes no difference. When I paint the containing JPanel red and don't add the 3D JPanel to it, it behaves as it should with a red screen, but otherwise I get the same white screen. arrgh! Why does this work when I run it in JCreator?
Reply | Threaded
Open this post in threaded view
|

Re: White screen from command line

gouessej
Administrator
In reply to this post by Robert
Robert wrote
Yup, same problem with a Java3D program that uses a JFrame fullscreen.
I would like you to try to use a plain java.awt.Canvas instead of GLCanvas or a canvas from Java3D. If you use a canvas from Java3D which is based on JOGL, it doesn't allow me to know whether the problem comes from AWT or JOGL.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: White screen from command line

Robert
ok, I'll try that tomorrow.
Reply | Threaded
Open this post in threaded view
|

Re: White screen from command line

Robert
SOLVED! (for me at least ;)

Thanks gouessej, you put me on the right track. I tried with using awt.Canvas and the problem still occured. I did some Goolge searching and found this thread that describes the problem:

http://stackoverflow.com/questions/4608730/awt-components-in-fullscreen-exclusive-mode

So I added -Dsun.java2d.d3d=false to my command line and it worked fine.
Reply | Threaded
Open this post in threaded view
|

Re: White screen from command line

gouessej
Administrator
You're welcome.

I'm sorry, I should have explained to you something important. Java3D 1.5.2 uses a native renderer based on Direct3D under Windows whereas Java3D 1.6.0 uses JOGL 2.0 everywhere. As a consequence, if the Java2D pipeline based on Direct3D is enabled, there is a risk of conflict at driver level with OpenGL (and then with JOGL). You're not forced to enable the Java2D pipeline based on OpenGL but it is highly recommended to disable the pipeline based on Direct3D for JOGL applications. I advise you to disable DirectDraw too:
-Dsun.java2d.noddraw=true

I didn't think that your problem came from this thing. Thanks for the feedback, really. It would be cool to write a sentence about that in the JOGL users guide.
Julien Gouesse | Personal blog | Website