Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  jogl2 GLWindow & exclusive fullscreen  (Read 2207 times)
0 Members and 1 Guest are viewing this topic.
Offline murderv

JGO n00b
*

Posts: 17



« on: 2010-06-05 20:41:51 »

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?

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

thanks in advance
Offline lhkbob

JGO Neuromancer
****

Posts: 1174
Medals: 35



« Reply #1 on: 2010-06-05 22:04:20 »

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.

Offline murderv

JGO n00b
*

Posts: 17



« Reply #2 on: 2010-06-05 22:18:26 »

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
Games published by our own members! Go get 'em!
Offline lhkbob

JGO Neuromancer
****

Posts: 1174
Medals: 35



« Reply #3 on: 2010-06-06 15:02:07 »

I've never seen the white screen before, but this is the code I usually use and I know it works on Mac:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
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());

Offline murderv

JGO n00b
*

Posts: 17



« Reply #4 on: 2010-06-06 15:40:55 »

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
Offline lhkbob

JGO Neuromancer
****

Posts: 1174
Medals: 35



« Reply #5 on: 2010-06-06 23:49:45 »

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.

Offline murderv

JGO n00b
*

Posts: 17



« Reply #6 on: 2010-06-07 06:09:27 »

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 ?
Offline lhkbob

JGO Neuromancer
****

Posts: 1174
Medals: 35



« Reply #7 on: 2010-06-07 11:21:04 »

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.

Offline murderv

JGO n00b
*

Posts: 17



« Reply #8 on: 2010-06-07 14:34:06 »

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

JGO n00b
*

Posts: 17



« Reply #9 on: 2010-07-25 09:33:41 »

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...

Games published by our own members! Go get 'em!
Offline H05h1

JGO n00b
*

Posts: 7



« Reply #10 on: 2010-09-15 17:19:24 »

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
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.307 seconds with 21 queries.