Display Change and Fullscreen Exclusive Mode

Hi,
I’m playing a bit with Jogl because i like very much both APIs (LWJGL and JOGL) and i can’t choose only one to use in my programs :).
So i know that LWJGL has its own native window system, so we can get a true fullscreen even on Linux.
But JOGL depends on AWT for the window part, and i’ve heard that Linux has no true fullscreen with AWT.

Okay, but what’s a true fullscreen ? With AWT, set a true fullscreen must be done with the setFullScreenWindow() method from de the GraphicsDevice class ?

But isFullScreenSupported() returns allways false on my system (Ubuntu Hoary and Breezy and JDK 1.5). But with the JDK 1.6, it returns “true”, and yes, i get a fullscreen exclusive mode (for example, i can’t switch between different desktops).

So with JDK 1.6, we have a true fullscreen (and certainly better performances) on Linux and AWT is no more a problem for JOGL, or am i wrong ?

But there is the problem of display change. isDisplayChangeSupported() allways returns “false” on my computer (Ubuntu, nvidia drivers, JDK 1.5_05 and JDK 1.6-b55).
Is there somebody who have display change supported on Linux ?
Will it be corrected in the next build of JDK 1.6 ?

Thanks for your answers, and sorry for my english, i’m a french speaker :).

If you want to try a little test that i’ve make and share the ouput of the class :

import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;



public class FSMTest {

static Frame frame;

	public static void main(String[] args) {
		frame = new Frame("Test");

		pressKey();
		GraphicsDevice graphicsDevice = GraphicsEnvironment
				.getLocalGraphicsEnvironment().getDefaultScreenDevice();



		if (graphicsDevice.isFullScreenSupported()) {
			System.out.println("FS Exclusive Mode supported");
		} else {
			System.out.println("FS Exclusive Mode non supported");
		}
		frame.setUndecorated(true);
		graphicsDevice.setFullScreenWindow(frame);
		
		if (graphicsDevice.isDisplayChangeSupported()) {
			System.out.println("Display change supported");
		} else {
			System.out.println("Display change non supported");
		}
		
		System.out.println("JVM version : "
				+ System.getProperty("java.version"));
		
	}

	public static void pressKey() {
		final int _KEY = KeyEvent.VK_ESCAPE;
		frame.addKeyListener(new KeyListener() {

			public void keyPressed(KeyEvent e) {
				if (e.getKeyChar() == _KEY) {
					System.exit(0);
				}
			}

			public void keyTyped(KeyEvent e) {
			}

			public void keyReleased(KeyEvent e) {
			}

		});
	}
}

Press escape to exit the fullscreen application.

Just for grins I ran your test on my Windows box here at work and it also returned that DisplayChanges were not supported. But then again the Graphics card here is pretty crappy so I amy try again when I get home.

The way the AWT APIs work you have to be in full-screen exclusive mode in order to even check to see whether display changes are supported. I’ve always thought this was poor behavior but at least it’s portably bad. There are a few full-screen demos in the jogl-demos workspace under demos/fullscreen which use some utilities to go full-screen in a portable way. You might want to look at the JSR-231 branch which is more up-to-date:


cvs -d :pserver:guest@cvs.dev.java.net:/cvs co -r JSR-231 -P jogl jogl-demos

Don’t forget to specify -Dsun.java2d.noddraw=true on the command line on Windows (or via Java Web Start) when using full-screen mode with JOGL to avoid DirectDraw/OpenGL driver-level conflicts.

Shame on me :-[ Thank for your helpful information, I’ve updated my code in my first post.
Now, isDisplayChangeSupported() returns “true” on my Linux computer with JDK 1.6 . :slight_smile:
But no changes with JDK 1.5, but it’s normal, FullScreen Exclusive Mode doesn’t work with JDK 1.5 on Linux (or at least with most of computers under Linux).

So there is no more problems with JOGL and Linux (at least with window part) ?

Thank for JSR-231, i will take a look on it.

With Mustang (Java SE 6) all of the issues around full-screen support on both Linux and Windows should be fixed.