Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Fullscreen Problem VISTA/XP  (Read 660 times)
0 Members and 2 Guests are viewing this topic.
Offline Therion_

JGO n00b
*

Posts: 17



« on: 2010-03-09 03:46:33 »

Hi,  i am using Jogl2 and got a little problem with the fullscreen mode (specially at vista)

first i got first the same problem with the white screen and stopped application at vista
when trying fullscreen mode.

i modify the code that it runs in an very bad way...but it runs..

when starting the application i get "black" screen..but the application is running (i hear sound effects for controlling).
now i need to (alt-tab) to the background/desktop of vista..and then switch (alt-tab) back to the
application..now it runs absolut good.

can anybody take a quick look at my init code what i am doing wrong?
(its not cleanup and the window mode is not used at moment)

thanks for any help Smiley


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  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
public static void main(String[] args) {


        Frame frame = new Frame("FSO");

       frame.setVisible(false);

        Cursor invisibleCursor = Toolkit.getDefaultToolkit().
        createCustomCursor(Toolkit.getDefaultToolkit().getImage(""), new Point(0,0), "invisibleCursor");

        //Maus Cursor verstecken!
       //frame.setCursor(invisibleCursor);

        screenWidth    = Toolkit.getDefaultToolkit().getScreenSize().width;
   screenHeight   = Toolkit.getDefaultToolkit().getScreenSize().height;

        GLCapabilities capabilities = new GLCapabilities(GLProfile.get(GLProfile.GL2));

        capabilities.setNumSamples(2);
        capabilities.setSampleBuffers(true);

        GLCanvas canvas = new GLCanvas(capabilities);

        animator = new Animator(canvas);

        canvas.addGLEventListener(new FSO_ENGINE());
 

     
        System.out.println("Vollbildmodusverfügbar :? "+GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().isFullScreenSupported());
        System.out.println("Refresh :? "+GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getRefreshRate());
        System.out.println("Bitdepth :? "+GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getBitDepth());
        System.out.println("Width :? "+GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth());
        System.out.println("Height :? "+GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight());



       screenWidth=GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getWidth();
       screenHeight=GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode().getHeight();
    screen_x=screenWidth;
       screen_y=screenHeight;


           frame.add(canvas);


           System.out.println("isActive :? "+ frame.isActive());

           frame.addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
                new Thread(new Runnable() {

                    public void run() {
                         animator.stop();
                         System.exit(0);
                    }
                }).start();
            }
        });
       
        canvas.addKeyListener(new FSO_ENGINE());
        canvas.addMouseListener(new FSO_ENGINE());
        canvas.addMouseWheelListener(new FSO_ENGINE());
        canvas.addMouseMotionListener(new FSO_ENGINE());



       
        frame.setUndecorated(true);    
        frame.setSize(screen_x, screen_y);

        frame.setLocationRelativeTo(null);
       
       
        GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(frame);
        GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setDisplayMode((new DisplayMode(screen_x,screen_y, 32, 60)));
       canvas.requestFocus();

        canvas.setFocusable(true);
       
       canvas.setVisible(true);


//FramebufferObject Size
fbo_width =(int) (screen_x*0.25f);
fbo_height=(int) (screen_y*0.25f);


 
//i try every stuff i find to get focus
frame.pack();
frame.setVisible(true);
   
canvas.display();
canvas.requestFocus();
frame.requestFocus();


       
Thread.yield();
animator.start();

}



Offline Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5866
Medals: 255


Hand over your head.


« Reply #1 on: 2010-03-09 07:54:07 »

Please try this first: (my reply)
http://www.java-gaming.org/topics/jogl-vista-bug/22086/msg/182284/view.html#msg182284

Hi, appreciate more people! Σ ♥ = ¾

Learn how to award medals... and work your way up the social rankings
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.058 seconds with 20 queries.