From 9979e80bed411990f48680249812e7211f8853fe Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Fri, 23 Aug 2002 00:43:10 +0000 Subject: [PATCH] Modifed osgGLUT viewer and messages in SGV to allow for start up in full screen mode. --- include/osgGLUT/Window | 1 + src/Demos/sgv/sgv.cpp | 1 + src/osgGLUT/Viewer.cpp | 11 +++++++++++ src/osgGLUT/Window.cpp | 8 ++++++++ 4 files changed, 21 insertions(+) diff --git a/include/osgGLUT/Window b/include/osgGLUT/Window index 9fdb7cafd..1dc3a6105 100644 --- a/include/osgGLUT/Window +++ b/include/osgGLUT/Window @@ -8,6 +8,7 @@ #include #include +#include namespace osgGLUT { diff --git a/src/Demos/sgv/sgv.cpp b/src/Demos/sgv/sgv.cpp index 9f6f67769..bef970e5f 100644 --- a/src/Demos/sgv/sgv.cpp +++ b/src/Demos/sgv/sgv.cpp @@ -43,6 +43,7 @@ void write_usage(std::ostream& out,const std::string& name) out <<" -stencil - use a visual with stencil buffer enabled, this "<< std::endl; out <<" also allows the depth complexity statistics mode"<< std::endl; out <<" to be used (press 'p' three times to cycle to it)."<< std::endl; + out <<" -f - start with a full screen, borderless window." << std::endl; out << std::endl; } diff --git a/src/osgGLUT/Viewer.cpp b/src/osgGLUT/Viewer.cpp index f82230aa1..5e3cec476 100644 --- a/src/osgGLUT/Viewer.cpp +++ b/src/osgGLUT/Viewer.cpp @@ -161,6 +161,15 @@ void Viewer::clear() /** read the command line string list, removing any matched control sequences.*/ void Viewer::readCommandLine(std::vector& commandLine) { + std::vector::iterator itr = commandLine.begin(); + for(;itr!=commandLine.end();++itr) + { + if (*itr=="-f") + { + _fullscreen = true; + break; + } + } _displaySettings->readCommandLine(commandLine); } @@ -1345,6 +1354,8 @@ void Viewer::help(std::ostream& fout) <<"f Toggle between fullscreen and the previous window size. Note, GLUT"<< std::endl <<" fullscreen works properly on Windows and Irix, but on Linux"<< std::endl <<" it just maximizes the window and leaves the window's borders."<< std::endl + <<" If started in full screen mode on Linux, window will be borderless"<< std::endl + <<" and will resize down, but will remain borderless."<< std::endl <<"Space Reset scene to the default view."<< std::endl <<"Esc Exit sgv."<< std::endl; } diff --git a/src/osgGLUT/Window.cpp b/src/osgGLUT/Window.cpp index 3db40c94e..771b7e752 100644 --- a/src/osgGLUT/Window.cpp +++ b/src/osgGLUT/Window.cpp @@ -43,6 +43,7 @@ Window::~Window() { } + void Window::clear() { } @@ -81,6 +82,13 @@ bool Window::open() glutSpaceballRotateFunc( spaceballRotateCB ); glutSpaceballButtonFunc( spaceballButtonCB ); + if( _fullscreen ) + { + _saved_ww = _ww; + _saved_wh = _wh; + glutFullScreen(); + } + _is_open = 1; return true; }