Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  White screen in fullscreen vista 64  (Read 1407 times)
0 Members and 1 Guest are viewing this topic.
Offline Knetic

Junior Newbie





« Posted 2010-04-14 07:29:33 »

Before anyone suggests it, i have seen this post. It doesn't provide a solution to my problem, even though it seems to be the exact same behavior that i'm getting.

My program works great in 32bit XP, however on 64bit win7 and vista OS's, it refuses to display correctly. Upon startup, it appears to clear the screen and draw normally for one frame, then just shows a white screen. I've been testing this pretty extensively, and found these things out.

1. The animator is running, and the game is updating.
2. It's not a buffering problem, it doesn't work with any mix of double, triple, or single buffering.
3. It's not a vsync problem, tried it with and without vsync.
4. The width/height of the canvas and screen are all correct, i don't mess with layouts or managers, just absolute positioning.
5. The displaymode is correct, i don't even bother changing it, just reading values from it. (read: not creating new ones). I have, in the past, tried setting the displaymode, but it appears unrelated to the problem.
6. Libraries are, of course, all being references and linked correctly. The program runs with no exceptions, eaten or otherwise.

What's worse is that if i alt-tab out of the game, and go back in, it will again display exactly one frame of the game, and then go back to a blank white screen.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
public class ScreenManager extends Frame
{
   // ... variables

    public ScreenManager()
    {
        super("Game");

        setLayout(null);

   // specifically to let the game know if the window is closed natively
       addWindowListener(new WindowAdapter()
        {
            public void windowClosing(WindowEvent e)
            {
                VMain.exit();
            }
        });
       
        setFullscreen();
        setupJOGL();        
        hideCursor();        
               
        // must put canvas in spotlight, since it gets focus.
       canvas.requestFocus();

        setVisible(true);
        canvas.createBufferStrategy(2);

   // double buffer created -after- visible, didn't help.
   }

    private void setFullscreen()
    {// sets to fullscreen mode.
       
        DisplayMode mode;
       
        device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
        mode = device.getDisplayMode();
       
   // just some global variables, nothing special is done here.
       setResolution(mode.getWidth(), mode.getHeight());
        COLOR_BITS = mode.getBitDepth();
        HERTZ = mode.getRefreshRate();
       
        setUndecorated(true);
        setIgnoreRepaint(true);
        setResizable(false);
        pack();
       
       device.setFullScreenWindow(this);
    }
     
   
    private void hideCursor()
    {
        setCursor(Toolkit.getDefaultToolkit().createCustomCursor(Toolkit.getDefaultToolkit().getImage(""), new Point(0, 0), "invis"));
    }
   
    private void showCursor()
    {
        setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    }
   
   
    private void setupJOGL()
    {
        GLCapabilities caps;
        Animator an;
       
        caps = new GLCapabilities();
        renderer = new VRenderer();
       
        caps.setDoubleBuffered(true);
        caps.setHardwareAccelerated(true);
       
        canvas = new GLCanvas(caps);
        canvas.addGLEventListener(renderer);
       
        canvas.setBounds(0, 0, RESOLUTION_X, RESOLUTION_Y);
        add(canvas);
       
        an = new Animator(canvas);
        an.setRunAsFastAsPossible(true);
        an.start();
    }


I'll stress that it works great in XP, and that the fault doesn't seem to be with the renderer code, but probably something with how i'm making the window.

I'm open to any wild ideas, i think i've exhausted the normal line of thought on this, so if anyone has any weird ideas or insight i'm definitely willing to listen.
Offline Knetic

Junior Newbie





« Reply #1 - Posted 2010-04-15 08:30:23 »

I just found a workaround. Apparently it has to do with the exclusive fullscreen mode. When using fullscreen, it will have the "white sheet" bug, but if you simply do this...

1  
2  
3  
4  
5  
6  
setUndecorated(true);
setIgnoreRepaint(true);
setResizable(false);
pack();

setSize(RESOLUTION_X, RESOLUTION_Y);


It works as expected.
Offline murderv

Senior Newbie





« Reply #2 - Posted 2010-04-22 02:49:47 »

Hi,

i am having exactly the same problem as you do with Windows7 64bit.
i've tried your workaround (setsize) but that just did not work for me..

did you have any problems with that or still works for you ?
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (55 views)
2014-04-15 18:08:23

BurntPizza (53 views)
2014-04-15 03:46:01

UprightPath (66 views)
2014-04-14 17:39:50

UprightPath (49 views)
2014-04-14 17:35:47

Porlus (66 views)
2014-04-14 15:48:38

tom_mai78101 (90 views)
2014-04-10 04:04:31

BurntPizza (151 views)
2014-04-08 23:06:04

tom_mai78101 (246 views)
2014-04-05 13:34:39

trollwarrior1 (204 views)
2014-04-04 12:06:45

CJLetsGame (211 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!