Re: [osg-users] osgViewer::View::setUpViewAcrossAllScreens and screen arrangement
On Tue, Feb 26, 2008 at 8:57 PM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: I just looked at src/osgViewer/GraphicsWindowWin32.cpp and noticed that the Win32WindowingSystem (subclass of osg::GraphicsContext::WindowingSystemInterface) has a method getScreenPosition(si, x, y, w, h) which gives me the information I need (i.e. the relative position of each screen, hence their physical arrangement). In other words, for 2 side-by-side screens, it will return screen 1 = 0, 0, 1280, 1024 screen 2 = 1280, 0, 1280, 1024 and for 2 screens one above the other, it will return screen 1 = 0, 0, 1280, 1024 screen 2 = 0, 1024, 1280, 1024 Have you tested and confirmed that this is the case? i.e. is it something we can rely upon? If so then it would be very useful. The only problem is that this class is not exposed, so I cannot use that method. I could copy the code into my project, but that's unclean, plus I wouldn't get any support for other OSes... Assuming the same thing is possible for X and/or MacOS, would it be possible to expose this method in osg::GraphicsContext::WindowingSystemInterface? It would then be possible to get osgViewer to support screen arrangements other than a basic horizontal linear setup, plus it would be nice for applications to use as well :-) Adding a virtual getScreenPosition to the WindowSystemInterface base class would be straight forward. I don't know yet how one would implement it under X11, but it should be possible. Given the above then the next tweak of View::setUpViewAcrossAllScreens() could then take this info, but... only if its actually implemented so we'd need a fallback. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgViewer::View::setUpViewAcrossAllScreens and screen arrangement
On Tue, Feb 26, 2008 at 10:57 PM, Stephan Huber [EMAIL PROTECTED] wrote: Jean-Sébastien Guay schrieb: Assuming the same thing is possible for X and/or MacOS, would it be possible to expose this method in osg::GraphicsContext::WindowingSystemInterface? It would then be possible to get osgViewer to support screen arrangements other than a basic horizontal linear setup, plus it would be nice for applications to use as well :-) I am using a similar mechanism for the OS X implementation of GraphicsWindow. GraphicsWindowCarbon::realize gets the delta form the WindowingInterface for a given screenIdentifier, so the window gets positioned on the right screen. One functionality is missing right now: if you move a window from one screen to another, the screen-identifier gets not updated, so if you go fullscreen, the window gets expanded on the wrong screen. This is something that is probably a bug on other OS's as well so is probably something worth being aware of. If there's a proposal for the new method I can code the stuff for OS X. Thanks, we might just come a calling quite soon ;-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgViewer::View::setUpViewAcrossAllScreens and screen arrangement
Hi Robert, In other words, for 2 side-by-side screens, it will return screen 1 = 0, 0, 1280, 1024 screen 2 = 1280, 0, 1280, 1024 and for 2 screens one above the other, it will return screen 1 = 0, 0, 1280, 1024 screen 2 = 0, 1024, 1280, 1024 Have you tested and confirmed that this is the case? i.e. is it something we can rely upon? If so then it would be very useful. Yes, I tested it and works (as long as it is set that way in the driver - i.e. just placing your monitors one above the other won't change anything if you don't change their arrangement in the driver :-) ). Adding a virtual getScreenPosition to the WindowSystemInterface base class would be straight forward. I don't know yet how one would implement it under X11, but it should be possible. OK, I'll submit something soon. Note that it will only have a concrete implementation for Win32 in the beginning... Given the above then the next tweak of View::setUpViewAcrossAllScreens() could then take this info, but... only if its actually implemented so we'd need a fallback. The fallback would probably be that screen n's x position would be the sum of all the previous screens' widths, which would give a linear setup (so no change compared to current behaviour). J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgViewer::View::setUpViewAcrossAllScreens and screen arrangement
Hi Robert, all, ... but I just thought if the OS/driver can give us the info for the physical screen setup we could avoid having that in the config file too. I just looked at src/osgViewer/GraphicsWindowWin32.cpp and noticed that the Win32WindowingSystem (subclass of osg::GraphicsContext::WindowingSystemInterface) has a method getScreenPosition(si, x, y, w, h) which gives me the information I need (i.e. the relative position of each screen, hence their physical arrangement). In other words, for 2 side-by-side screens, it will return screen 1 = 0, 0, 1280, 1024 screen 2 = 1280, 0, 1280, 1024 and for 2 screens one above the other, it will return screen 1 = 0, 0, 1280, 1024 screen 2 = 0, 1024, 1280, 1024 The only problem is that this class is not exposed, so I cannot use that method. I could copy the code into my project, but that's unclean, plus I wouldn't get any support for other OSes... Assuming the same thing is possible for X and/or MacOS, would it be possible to expose this method in osg::GraphicsContext::WindowingSystemInterface? It would then be possible to get osgViewer to support screen arrangements other than a basic horizontal linear setup, plus it would be nice for applications to use as well :-) Thanks, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgViewer::View::setUpViewAcrossAllScreens and screen arrangement
Jean-Sébastien Guay schrieb: Assuming the same thing is possible for X and/or MacOS, would it be possible to expose this method in osg::GraphicsContext::WindowingSystemInterface? It would then be possible to get osgViewer to support screen arrangements other than a basic horizontal linear setup, plus it would be nice for applications to use as well :-) I am using a similar mechanism for the OS X implementation of GraphicsWindow. GraphicsWindowCarbon::realize gets the delta form the WindowingInterface for a given screenIdentifier, so the window gets positioned on the right screen. One functionality is missing right now: if you move a window from one screen to another, the screen-identifier gets not updated, so if you go fullscreen, the window gets expanded on the wrong screen. If there's a proposal for the new method I can code the stuff for OS X. cheers, Stephan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgViewer::View::setUpViewAcrossAllScreens and screen arrangement
Hi Robert, Quick question about screen arrangement. As I understand it, WindowingSystemInterface currently has no way of reporting the arrangement of the screens (physically), so there is no real way to support, for example, a single view spread over 4 screens arranged in a 2x2 square. Is that right? If I read the code right, the only thing you do in setUpViewAcrossAllScreens is to add a horizontal translation to each screen (translate_x). Such a setup would require a translate_y as well. Does that sound right? I guess to support 4 screens in such an arrangement, it would be up to the application to set it up correctly, having prior knowledge of the physical screen setup... I'm battling this a bit right now, as I'm trying to get a very general system to set up viewports across screens, and I'm having a bit of trouble with this. It just seems each case I need to support is totally different, and as I see it, you can only go so far (only so many assumptions you can make) without knowing the actual physical screen arrangement. Any thoughts on this? Thanks, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgViewer::View::setUpViewAcrossAllScreens and screen arrangement
Hi J-S, The defaults settings in osgViewer can't cope with novel display arrangements, and this is well beyond the scope of WindowSystemInterface as once you start going beyond nx1 displays things can very rapidly get very complicated. The right way to handle complex screen arrangements is to use a configuration file that is set up to describe the displays you have and the view and projection matrix offsets that are appropriate for them. The .view format is just sophisticated enough to handle this type of complex arrange yet, but its my plan to extend it once I get a breather. In the meantime you could use the .cfg plugin to read a Producer style configuration file to describe your display layout and then just load this into your viewer. i.e. osgviewer cow.osg -c twobytwo.cfg Robert. On Mon, Feb 25, 2008 at 4:00 PM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: Hi Robert, Quick question about screen arrangement. As I understand it, WindowingSystemInterface currently has no way of reporting the arrangement of the screens (physically), so there is no real way to support, for example, a single view spread over 4 screens arranged in a 2x2 square. Is that right? If I read the code right, the only thing you do in setUpViewAcrossAllScreens is to add a horizontal translation to each screen (translate_x). Such a setup would require a translate_y as well. Does that sound right? I guess to support 4 screens in such an arrangement, it would be up to the application to set it up correctly, having prior knowledge of the physical screen setup... I'm battling this a bit right now, as I'm trying to get a very general system to set up viewports across screens, and I'm having a bit of trouble with this. It just seems each case I need to support is totally different, and as I see it, you can only go so far (only so many assumptions you can make) without knowing the actual physical screen arrangement. Any thoughts on this? Thanks, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgViewer::View::setUpViewAcrossAllScreens and screen arrangement
Hi Robert, The defaults settings in osgViewer can't cope with novel display arrangements, and this is well beyond the scope of WindowSystemInterface as once you start going beyond nx1 displays things can very rapidly get very complicated. Nothing novel in this case, just trying to get something as general as I can (so it can be used with little to no modification in most of our projects). The right way to handle complex screen arrangements is to use a configuration file that is set up to describe the displays you have and the view and projection matrix offsets that are appropriate for them. That's what I was thinking too, and it's a bit cumbersome. I would have liked to be able to get the info I need from the display driver (since it obviously has it, in order to set up the desktop correctly). But I haven't had the time or the energy to get into this yet. In the meantime you could use the .cfg plugin to read a Producer style configuration file to describe your display layout and then just load this into your viewer. i.e. osgviewer cow.osg -c twobytwo.cfg I haven't been able to get much documentation about the Producer configuration file format, nor any good examples. Do you have any pointers on this? Thanks, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgViewer::View::setUpViewAcrossAllScreens and screen arrangement
On Mon, Feb 25, 2008 at 6:06 PM, Jean-Sébastien Guay [EMAIL PROTECTED] wrote: The defaults settings in osgViewer can't cope with novel display arrangements, and this is well beyond the scope of WindowSystemInterface as once you start going beyond nx1 displays things can very rapidly get very complicated. Nothing novel in this case, just trying to get something as general as I can (so it can be used with little to no modification in most of our projects). Trust in configuration files, they are very powerful for this type of stuff. For instance you can have it work on one screen of your four using one file, then another configuration file can set up all four. etc. etc. The right way to handle complex screen arrangements is to use a configuration file that is set up to describe the displays you have and the view and projection matrix offsets that are appropriate for them. That's what I was thinking too, and it's a bit cumbersome. I would have liked to be able to get the info I need from the display driver (since it obviously has it, in order to set up the desktop correctly). But I haven't had the time or the energy to get into this yet. Well if you get can reliable geometry information then it might give up a better leg up if choosing appropriate defaults. However, configuration files are the most flexible way to do things. You can have quite high level configurations like I've down so far with the .new configuration files in the OpenSceneGraph-Data/Configuration directory. These high level functions just set the parameters use by the setUpView*() methods. Perhaps one can add further setUpView*() methods such as for a NxM power wall (in your cane N=2, M=2) and then add this to .view support. In the meantime you could use the .cfg plugin to read a Producer style configuration file to describe your display layout and then just load this into your viewer. i.e. osgviewer cow.osg -c twobytwo.cfg I haven't been able to get much documentation about the Producer configuration file format, nor any good examples. Do you have any pointers on this? Producer has the BNF file for the format and a set of examples .cfg, you'll need to search Producer distribution itself. There is also the option of just rolling ones sleeves up and adding to the work I've started in the src/osgPlugins/osgViewer which provides the .view implementation. The .view format is just an extension of the standard .osg format. Robert. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgViewer::View::setUpViewAcrossAllScreens and screen arrangement
Hi Robert, Trust in configuration files, they are very powerful for this type of stuff. For instance you can have it work on one screen of your four using one file, then another configuration file can set up all four. etc. etc. Well we already have config files for the views (similar to your .view files) but I just thought if the OS/driver can give us the info for the physical screen setup we could avoid having that in the config file too. But I'll probably do it anyways as it'll be less work I imagine. Thanks, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org