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

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");
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);
fbo_width =(int) (screen_x*0.25f); fbo_height=(int) (screen_y*0.25f);
frame.pack(); frame.setVisible(true); canvas.display(); canvas.requestFocus(); frame.requestFocus();
Thread.yield(); animator.start();
} |