Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  jogl2 GLWindow & exclusive fullscreen  (Read 3334 times)
0 Members and 1 Guest are viewing this topic.
Offline murderv

Senior Newbie





« Posted 2010-06-06 02: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 Knight


Medals: 32



« Reply #1 - Posted 2010-06-06 04: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

Senior Newbie





« Reply #2 - Posted 2010-06-06 04: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! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline lhkbob

JGO Knight


Medals: 32



« Reply #3 - Posted 2010-06-06 21: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

Senior Newbie





« Reply #4 - Posted 2010-06-06 21: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 Knight


Medals: 32



« Reply #5 - Posted 2010-06-07 05: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

Senior Newbie





« Reply #6 - Posted 2010-06-07 12: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 Knight


Medals: 32



« Reply #7 - Posted 2010-06-07 17: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

Senior Newbie





« Reply #8 - Posted 2010-06-07 20: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_

Senior Newbie





« Reply #9 - Posted 2010-07-25 15: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! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline H05h1

Junior Newbie





« Reply #10 - Posted 2010-09-15 23: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]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (12 views)
2014-07-29 18:09:19

Riven (8 views)
2014-07-29 18:08:52

Dwinin (9 views)
2014-07-29 10:59:34

E.R. Fleming (26 views)
2014-07-29 03:07:13

E.R. Fleming (10 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (27 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!