Creating large GLWindows on multiple monitor setups

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

Creating large GLWindows on multiple monitor setups

ac
Hello, I'm testing the pure NEWT native windows to create large displays across multiple monitors.

I looked at the com.jogamp.opengl.test.junit.newt.mm.TestScreenMode01cNEWT code to get some ideas, and previous posts in the forum.

What I have observed so far is that as long the size of the GLWindow is smaller than the monitor's viewport size in windows units, then I have no problem to position the GLWindow at a location of my choice. However, once the

To make things more concrete, I'm working on a Retina Mac machine with an external monitor, so when I print the MonitorDevices I see:

Monitor[Id 0x0, 331 x 206 mm, viewport [ 0 / 0  2880 x 1800 ] [pixels], [ 0 / 0  1440 x 900 ] [window], orig [Id 0x1, [ 2880 x 1800 pixels x 32 bpp ] @ 60.0 Hz, flags [], 0 degr], curr [Id 0x1, [ 2880 x 1800 pixels x 32 bpp ] @ 60.0 Hz, flags [], 0 degr], modeChanged false, modeCount 64]

Monitor[Id 0x1, 799 x 449 mm, viewport [ 2880 / 0  1920 x 1080 ] [pixels], [ 1440 / 0  1920 x 1080 ] [window], orig [Id 0x1, [ 1920 x 1080 pixels x 32 bpp ] @ 60.0 Hz, flags [], 0 degr], curr [Id 0x1, [ 1920 x 1080 pixels x 32 bpp ] @ 60.0 Hz, flags [], 0 degr], modeChanged false, modeCount 72]

So I'm creating a GLWindow of various sizes. As long as these sizes are smaller than 1440x900, I can place the window anywhere in the first monitor. However, once the size is somewhat larger than 1440x900, in gets automatically placed at the upper left corner of the second monitor, and the setPostition() method doesn't seem to have any affect.

Another strange thing I noticed is that when if the GLWindow has a size that exceeds the size of the monitor is placed in, and I drag it around, it seems that the frame has exactly the size of the monitor...

Do you have any specific examples to get a better sense of how to use GLWindow, specially under multi-monitor configs?



 
ac
Reply | Threaded
Open this post in threaded view
|

Re: Creating large GLWindows on multiple monitor setups

ac
Never mind, at least on Mac I found out that in order to have a GLWindow spanning across multiple monitors I need to disable the "Display have separate Spaces" option in the Mission Control settings.
Reply | Threaded
Open this post in threaded view
|

Re: Creating large GLWindows on multiple monitor setups

gouessej
Administrator
Which version of OS X do you use? Thank you for the feedback anyway.
Julien Gouesse | Personal blog | Website
ac
Reply | Threaded
Open this post in threaded view
|

Re: Creating large GLWindows on multiple monitor setups

ac
10.9.5

btw, we switched to GTWindow (no AWT embedding) in the opengl renderer in Processing, I will probably have more questions about NEWT as we move forward with the changes.
ac
Reply | Threaded
Open this post in threaded view
|

Re: Creating large GLWindows on multiple monitor setups

ac
One puzzling thing is the following: I create a GLWindow larger than the monitor size: for the sake of the argument GLWindow's width and hight are 1440x1024, while the monitor is 1440x900.

The canvas appears to be placed at the lower right corner of the window, so the top portion (124 pixels) of it is outside of view. So my first question: Is there any way to "attach" the canvas to the upper right corner of the window? I haven't found any API that seems to do that.

Also, even though querying the window dimensions gives 1440x1024, its actual size is 1440x900. So, the windows are always constrained by the size of the containing monitor device?

See the screen capture below of the window, the cross should be centered but because of the placement of the canvas, is offset upwards:

ac
Reply | Threaded
Open this post in threaded view
|

Re: Creating large GLWindows on multiple monitor setups

ac
Hi guys, do you have any comments on these issues? Perhaps I'm overlooking some aspects of the way NEWT works? I went through a few test cases, but that didn't help me to solve the window placement issues I mentioned above. Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Creating large GLWindows on multiple monitor setups

gouessej
Administrator
I thought that you could work with this "limitation". I don't see any problem as you know how the placement in NEWT works.
Julien Gouesse | Personal blog | Website
ac
Reply | Threaded
Open this post in threaded view
|

Re: Creating large GLWindows on multiple monitor setups

ac
Ok, I look further into the window placement with NEWT, and see if I can figure things out.

However, I think the window size is a separate issue: if I create a window of size 1440x900 on a 1280x900 screen, I would expect that if I drag the window horizontally, then I would be able to see the portions of the window that fell outside of the screen. But this doesn't happen, the window appears to have a width of 1280. Maybe this is a Mac-specific thing?
Reply | Threaded
Open this post in threaded view
|

Re: Creating large GLWindows on multiple monitor setups

gouessej
Administrator
How do you create your GLWindow? Please can you post some code?
Julien Gouesse | Personal blog | Website
ac
Reply | Threaded
Open this post in threaded view
|

Re: Creating large GLWindows on multiple monitor setups

ac
Basically:

Display display = NewtFactory.createDisplay(null);
display.addReference();
Screen screen = NewtFactory.createScreen(display, 0);
screen.addReference();

profile = GLProfile.getGL2ES1();
GLCapabilities caps = new GLCapabilities(profile);
window = GLWindow.create(screen, caps);

window.setPosition(sketchX, sketchY);
window.setSize(sketchWidth, sketchHeight);

if (fullScreen) {
  if (spanDisplays) {
    window.setFullscreen(monitors);
  } else {
    window.setFullscreen(true);
  }
}

where sketchX, sketchY, sketchWidth, fullScreen, etc. are the arguments of the init method. The full thing is in the initCanvas() method in:

https://github.com/processing/processing/blob/master/core/src/processing/opengl/PSurfaceNEWT.java