Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (780)
Games in Android Showcase (233)
games submitted by our members
Games in WIP (857)
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 6907 times)
0 Members and 1 Guest are viewing this topic.
Offline murderv

Senior Newbie

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

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 19: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:
DisplayMode mode;
GraphicsDevice gDev = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();

if (gDev.isFullScreenSupported()) {
   if (gDev.isDisplayChangeSupported()) {
      mode = chooseBestMode(gDev.getDisplayModes(), optionsRequest, width, height);
   } 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 19: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 03: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 10: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

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

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 15: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 18: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 13: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 21: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:
Pages: [1]
  ignore  |  Print  

hadezbladez (1156 views)
2018-11-16 13:46:03

hadezbladez (521 views)
2018-11-16 13:41:33

hadezbladez (1184 views)
2018-11-16 13:35:35

hadezbladez (268 views)
2018-11-16 13:32:03

EgonOlsen (2564 views)
2018-06-10 19:43:48

EgonOlsen (2782 views)
2018-06-10 19:43:44

EgonOlsen (1562 views)
2018-06-10 19:43:20

DesertCoockie (2266 views)
2018-05-13 18:23:11

nelsongames (2118 views)
2018-04-24 18:15:36

nelsongames (2812 views)
2018-04-24 18:14:32
Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20 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‑
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!