Full screen mode under Linux

Is there a way to get JOGL to go into full screen mode under Linux?

This isn’t quite what I was looking for, but it gets rid of the window decorations, so it’ll do for now. Thought I’d pass it along:

Frame frame = new Frame(“demo”);
frame.setUndecorated(true);

Doesn’t the normal way to enter fullscreen mode also work for Linux? I don’t know but think it should - because it’s Java. :slight_smile:
Please have a look at http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html

While I don’t use Jogl yet, but Gl4java, they’re similar from our programmer’s point of view (internal they’re different I read) so I think you’ve just to set the frame to fullscreen which contains your GLAnimCanvas (or how it’s called in Jogl), and there you are.

So when you create your JFrame (or whatever) I usually do:

class Myframe extends JFrame

void Myframe()
{
// create GLcanvas, add it to the rootpane, etc.

if (fullscreen_wanted) {
setUndecorated(true);
setResizable(false);
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice dev = env.getDefaultScreenDevice();
dev.setFullScreenWindow(this);
dev.setDisplayMode(new DisplayMode(800, 600, 32, DisplayMode.REFRESH_RATE_UNKNOWN));
validate();
}
else {
setSize(800, 600);
setVisible(true);
}
}

(This is just the “fast” way for tests; it’s not recommended in the tutorial because you’ve to check if the modes are available and switch back to the old mode in the end of your programm.)

That should fail in linux b/c as far as I understand it, Full Screen Excl. mode doesn’t work in Linux. You should check first if FSEM is available and iff its available, then switch.