diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 7908e7460..0eb63c586 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include @@ -63,6 +64,7 @@ Viewer::Viewer(osg::ArgumentParser& arguments) arguments.getApplicationUsage()->addCommandLineOption("--clear-color ","Set the background color of the viewer in the form \"r,g,b[,a]\"."); arguments.getApplicationUsage()->addCommandLineOption("--screen ","Set the screen to use when multiple screens are present."); arguments.getApplicationUsage()->addCommandLineOption("--window ","Set the position (x,y) and size (w,h) of the viewer window."); + arguments.getApplicationUsage()->addCommandLineOption("--borderless-window ","Set the position (x,y) and size (w,h) of a borderless viewer window."); arguments.getApplicationUsage()->addCommandLineOption("--run-on-demand","Set the run methods frame rate management to only rendering frames when required."); arguments.getApplicationUsage()->addCommandLineOption("--run-continuous","Set the run methods frame rate management to rendering frames continuously."); @@ -136,7 +138,14 @@ Viewer::Viewer(osg::ArgumentParser& arguments) bool ss3d = false; bool wowvx20 = false; bool wowvx42 = false; - if ((wowvx20=arguments.read("--wowvx-20")) || (wowvx42=arguments.read("--wowvx-42")) || arguments.read("--wowvx")) + + if (arguments.read("--borderless-window",x,y,width,height)) + { + osg::ref_ptr sw = new osgViewer::SingleWindow(x, y, width, height, screenNum); + sw->setWindowDecoration(false); + apply(sw.get()); + } + else if ((wowvx20=arguments.read("--wowvx-20")) || (wowvx42=arguments.read("--wowvx-42")) || arguments.read("--wowvx")) { osg::ref_ptr wow = new WoWVxDisplay; @@ -510,7 +519,13 @@ void Viewer::realize() int x = -1, y = -1, width = -1, height = -1; osg::getEnvVar("OSG_WINDOW", x, y, width, height); - if (width>0 && height>0) + if (osg::getEnvVar("OSG_BORDERLESS_WINDOW", x, y, width, height)) + { + osg::ref_ptr sw = new osgViewer::SingleWindow(x, y, width, height, screenNum); + sw->setWindowDecoration(false); + apply(sw.get()); + } + else if (width>0 && height>0) { if (screenNum>=0) setUpViewInWindow(x, y, width, height, screenNum); else setUpViewInWindow(x,y,width,height);