What are NEWT Screen and Display?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

What are NEWT Screen and Display?

jmaasing
What are com.jogamp.newt.Screen and com.jogamp.newt.Display supposed to represent? They sound like they should mean almost the same.
I never get anything back from Screen.getAllScreens() and Display.getAllDisplays() - just empty lists on my OSX.

The reason I looked into it was that I thought that It would be nice if my application opened on the same monitor as it ran last time, for when you have 2 monitor devices to display. Not a big problem but I got curious
Reply | Threaded
Open this post in threaded view
|

Re: What are NEWT Screen and Display?

gouessej
Administrator
Hi

Have you ever called this method?
http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/newt/Display.html#addReference()

You shouldn't get empty lists under OS X.

The physical monitor device is represented by MonitorDevice, its modes are represented by MonitorMode (it's a bit any equivalent of DisplayMode in AWT). Display is the graphical display, I think that the term "display" is used here with the typical Unix / Linux meaning. The virtual monitor is represented by Screen, such a Screen may use several physical monitors and then several instances of MonitorDevice.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: What are NEWT Screen and Display?

jmaasing
No I have not, I have no instance of the Display class to call that method on. But I figured out what I did wrong, I called the method before I opened any NEWT windows. After I have created and opened a NEWT window I can query Display.getAllDisplays()  and Screen.getAllScreens();

Thank you for your explanation, that would be a good thing to add to the javadoc :)
Reply | Threaded
Open this post in threaded view
|

Re: What are NEWT Screen and Display?

gouessej
Administrator
jmaasing wrote
No I have not, I have no instance of the Display class to call that method on. But I figured out what I did wrong, I called the method before I opened any NEWT windows. After I have created and opened a NEWT window I can query Display.getAllDisplays()  and Screen.getAllScreens();
Actually, it is possible to get this information before opening any NEWT window, I do so in TUER and I think that there is at least one unit test doing that too.

jmaasing wrote
Thank you for your explanation, that would be a good thing to add to the javadoc :)
You're welcome. You can still write a bug report pointing to this thread as this is a documentation bug. I would like to know Sven's opinion about what I wrote about these classes.
Julien Gouesse | Personal blog | Website