JOGL/Vista bug

I have a problem with some JOGL code that runs fine on XP but not on Vista. It’s a client/server game arrangement. When I run the server and client screen on the same computer it works fine on XP but on Vista, I get some sort of ‘ghost’ window - a window of the same size and name as my rendering window, but completely white. And on top of that, the server no longer seems to redraw properly (although dumping networked inputs shows that it is still getting updates from the client)

I know this is probably a long shot, but can anyone think of what might cause those duplicate windows to display on Vista?

Recent testing has shown that this actually has nothing to do with the client/server set up. I’ve discovered that this duplicate window was also coming up when I run the code in standalone mode which should have one window and no networking.

I’ve attached the code I used to establish the frame and link it to JOGL. If anyone can see anything untoward, I’d appreciate a hand :slight_smile:

    public Renderer(String title){
        frame = new Frame(title);

        game = Game.instance;

        GLCapabilities caps = new GLCapabilities();
        caps.setDoubleBuffered(true);
        caps.setHardwareAccelerated(true);

        canvas = new GLCanvas();

        final float sScale = 0.7f;
        screenWidth  = (int)(sScale * 800);//1280;
        screenHeight = (int)(sScale * 600);//860;

        canvas.addGLEventListener(this);

        frame.setIgnoreRepaint(true);
        frame.setSize(screenWidth, screenHeight);

        gEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
        gDevice      = gEnvironment.getDefaultScreenDevice();

        if(WANT_FULLSCREEN){
            frame.setUndecorated(true);

            oldDisplayMode = gDevice.getDisplayMode();
            displayMode = new DisplayMode(1024, 768, 32, DisplayMode.REFRESH_RATE_UNKNOWN);

            gDevice.setFullScreenWindow(frame);
            gDevice.setDisplayMode(displayMode);
        }

        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                game.stop();
            }
        });

        canvas.addKeyListener(game);
        canvas.addMouseMotionListener(game);
        canvas.addMouseListener(game);
        canvas.addMouseWheelListener(game);

        frame.add(canvas);
        frame.setVisible(true);
    }

Last time i worked with FSEM in AWT was in the 1.4 era, so this might be a little outdated:

never ever create your own DisplayMode object. Query the existing modes, and pick the one that fits your needs. Back then, it really gave me a lot of problems: even when creating an exact duplicate of a DisplayMode that I queried. So this might sound a bit vague, but it’s easy enough to give it a try, and see whether this issue was fixed since Java 1.4.

Riven is right. Query existing display modes, call GraphicsDevice.getDisplayModes().

You’re right that the code as it stands is not acceptable for general release, but as it happens, I’m not running this in full screen mode (WANT_FULLSCREEN is false in my code at the moment). I will certainly make that change when I am ready to release, however.

you may try to disable “Aero” just to see if it help (this is one of the big difference between XP/Vista).

NB: once tuned Vista just look & work nearly the same as XP ans is also as stable than XP

i have tried to get displaymodes and still i am getting the white screen problem.
my code is just the same as everything, create frame, create glcanvas, set params for frame and canvas, add canvas to frame,
get displaymode, setfullscreenwindow, create and start an animator.

i just no idea what can this be… i am on windows 7 64bit… anyone else having white screen problem on fullscreen mode ??

I worked around something very similar by running with “-Dsun.java2d.noddraw=false”. In my case, it worked ok when launched from Eclipse, but exhibited similar problems to yours when running the exported application, until I added that jvm argument.

that still didn’t work for me :frowning:
this is starting to be annoying. i haven’t tried on any other OS, still why would i, if this is my dev machine :confused:

i have no idea on how to fix this…

Just for the sake of ruling out driver bugs: does it work in LWJGL?

I have tested LWJGL Fullscreen example found on their website… it worked just fine!

Meanwhile does any of you have any simple test of yours using JOGL and fullscreen i could test?
a working example for testing purposes only.

i just can’t see what my problem could be and if it is really my code or my machine…

appreciate it,

Hi!
I’m having the same ‘white screen’ issue under Vista 32bit. I’ve tried all known java2d/jogl vm-switches with no success so far (ofcourse u have to use “-Dsun.java2d.noddraw=false” otherwise fullscreen never even starts to work) I have so far not found any real wokring solution for the bug but pinpointed it to be a Nvidia specific problem (have a second ati machine with win 7 64bit where everything works fine).

At least for me it disappears when I disable Aero, wich is ofcourse unacceptable, but at least hints that it has stg to do with the new DWM in Vista AND the NVidia driver. Also if u press alt-tab to minimize the window and the alt-tab it back to fullscreen the white-screen bug disappears and my application renders correctly. Also not to use FBO’s seems to help with some driver versions, but with the newest driver version even if u avoid the FBO’s completely u have the white-screen bug.

I am currently working on this issue and have the ‘feeling’ (no real evidence) that it has stg to do with the the order or the timing when doing the initialization of the frame/glcanvas.

I have just tried GLJFrame from joglutils, it can be found at jogl-dev website.
the problem remains. One thing i’ve noticed is that noe even joglutils uses exclusive modes. it sure sets a fullscreen window, but does not set any special DisplayMode. I believe this is what makes it a exclusive fullscreen mode.

Atleast i can say the problem shouldn’t be my approach to get exclusive fullscreen modes.

I have been working with JOGL 2.x and tested GLWindow, but that just doesn’t seem to do exclusive fullscreen modes. So that doesn’t work too.

Hopefully this will be fixed, or atleast someone with better knowledge can help us on this one. I believe lots of people should be getting this problem, it can’t just be ignored.

Ok, I’ve made some progress on this issue.

I found this blog entry: http://my2iu.blogspot.com/2004/12/jogl-and-resizing-windows.html

… he states: “If I force an extra buffer swap after a reshape, everything does seem to work correctly (the white screen still shows, but it’s quickly overwritten during the successive call to display). Perhaps it’s a driver problem.”.

So I inserted an explicit GLDrawable.swapBuffers() call at the end of my reshape() method in the GLEventlistener and it WORKED! :smiley: I further tested it with a NVIDIA and an ATI card and it seems to work well on both. I’m currently evaluating different driver versions to test if its a stable solution or just another buggy workaround for a specific driver release. Hope this works for u too …

hi H0,

can you send me an example of your working fullscreen app?
i would love to test it here and see if that works.

i tried what you said and no luck still…

PS. are you setting exclusive fullscreen mode? using setDisplayMode/setFullscreenWindow ?

Hi!
Sorry, kinda false alarm from my side. Did some extensive testing with the newest drivers and on NVidia the bug reappears even with the “swapbuffers()” workaround wich previously worked around the issue :frowning: So I guess I’m back to square one …

And yes, I’m using fullscreen exclusive mode and explicitly change the resolution. In windowed mode I don’ have the white screen problems. Only in FEM.