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
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();
}