jogl2 GLWindow & exclusive fullscreen

Hi, i’ve been working with jogl2 and first thing i wanted to try was fullscreen mode. I gave GLWindow a try and easily made a fullscreen window but it just isn’t what i expected. I thought this would get me through problems i had before on using jogl for exclusive fullscreen modes but doesn’t look like it.

What it does is just scale your window to the dimension of the screen.
Is there any way to get working exclusive fullscreen modes with JOGL at all?

  1. Has anyone played with GLwindow and go it to work with costum GLCapabilities ?

thanks in advance

Unfortunately, I believe this is a handicap of the current GLWindow implementation/API. The Newt bindings were meant to be a low-level native window layer and for some reason, the designers feel this excludes the functionality of changing a screen’s display mode.

The only way to get fullscreen with exclusive mode/display changes is to use the AWT provided GLCanvas in a normal Frame and use AWT’s fullscreen support. This also has the “benefit” of using the AWT pipeline for JOGL 2, which currently is much more stable on Mac. Newt is practically unusable on Mac because of threading issues and weird ordering problems that crash the app when a user closes a window.

thanks lhkbob.

well i haven’t been able to get exclusive fullscreen mode even with AWT GLCanvas+Frame. For some weird reason all i get is a white screen when using setDisplayMode. I use Animator for my mainloop thread.

I’ve been looking into jME canvas/jogl code for the window and glcanvas handling code they do not use any Animator stuff. I believe i’ve seen this before on different frameworks. It makes me wonder why the reason of the white screen.

Have you ever has anything like it and found a solution?

thanks

I’ve never seen the white screen before, but this is the code I usually use and I know it works on Mac:


DisplayMode mode;
GraphicsDevice gDev = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
gDev.setFullScreenWindow(frame);

if (gDev.isFullScreenSupported()) {
	if (gDev.isDisplayChangeSupported()) {
		mode = chooseBestMode(gDev.getDisplayModes(), optionsRequest, width, height);
		gDev.setDisplayMode(mode);
	} else
		mode = gDev.getDisplayMode();
} else
	mode = gDev.getDisplayMode();
		
// make it fullscreen, even if we're not in exclusive mode
frame.setSize(mode.getWidth(), mode.getHeight());

well my code is basically the same, still i can’t get it to work with exclusive fullscreen mode.
Today i tried something different. I tried to setDisplayMode using my screen resolution and i got the white screen again, but then i did ALT+TAB and it worked. Well it worked for sometime, then it just stopped working again.
I’ve been getting this since i remember. Never got exclusive fullscreen mode fully functional and using dimensions of the screen is not good idea, for example people using full HD resolutions will end up with slow apps as it will kill fillrate.

Hmm maybe i should take this code and try on some other machine…

my machine is win7 64bit + nvidia

Are you running this code on the proper thread? If this is anything like the rest of AWT and Swing, you need to run things on the AWT EDT thread. The white screen and random breakage sounds like a threading issue to me.

Well i’m not really sure what means running the code in the proper thread, but here’s what i do:

Create Frame
Create GLCanvas(caps)

addGLListener( listener );

Check for fullscreen and displaychange support.
if( true )
set fullscreen
setdisplaymode

add a windows listener (for closing option)
Animator( canvas );
animator.start();

this will create my running thread that will run the code inside the callback class GLListener
Am i missing anything?

I’ve noticed you have your own java rendering system. i’ve checked your code briefly and you too don’t seem to use any Animator, you’re running your own thread sytem? is that all just for multiple context support ?

Looking at the AWT code, it appears as though display changes are synchronized so it shouldn’t actually matter what Thread requests the display change (my mistake). My recommendation is to test on other machines and to post a small test case here for us to look over.

And my rendering system is indeed intended for use with multiple contexts.

i will do some testing and get back here with some results and a test app.
thanks for all the support

some late response …

i was also getting this white screen situation with
windows vista/windows 7… xp was running perfect…

after a while i see that the first rendered screen
appears when clicking mouse…and then black screen/freeze … i used the robot funktion
to simulate a mouse click one time direct after initialisation of opengl/jogl2…
it was only a simple test…and now it works perfect with it… (on all windows versions)


i think its the theory/practice thing

-theory is when someone know how it works…and its not running
-practise is… its running and nobody knows why…

I’ve submitted a bugreport a while ago regarding the “white-screen” issue and provided a workaround for it using Java-Native-Access. That way it works at least under windows.

Take a look here: http://jogamp.org/bugzilla/show_bug.cgi?id=403