Equalizer  1.2.1
osgScaleViewer/main.cpp
00001 
00002 /*
00003  * Copyright (c)
00004  *   2008-2009, Thomas McGuire <thomas.mcguire@student.uni-siegen.de>
00005  *   2010, Stefan Eilemann <eile@equalizergraphics.com>
00006  *   2010, Sarah Amsellem <sarah.amsellem@gmail.com>
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions are met:
00010  *
00011  * - Redistributions of source code must retain the above copyright notice, this
00012  *   list of conditions and the following disclaimer.
00013  * - Redistributions in binary form must reproduce the above copyright notice,
00014  *   this list of conditions and the following disclaimer in the documentation
00015  *   and/or other materials provided with the distribution.
00016  * - Neither the name of Eyescale Software GmbH nor the names of its
00017  *   contributors may be used to endorse or promote products derived from this
00018  *   software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00021  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00022  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00023  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
00024  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00025  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00026  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00027  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00028  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00029  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00030  * POSSIBILITY OF SUCH DAMAGE.
00031  */
00032 
00033 #ifdef WIN32
00034 #define EQ_IGNORE_GLEW 
00035 #endif
00036 
00037 #include "osgScaleViewer.h"
00038 #include "initData.h"
00039 #include "nodeFactory.h"
00040 
00041 int main( const int argc, char** argv )
00042 {
00043     // 1. Equalizer initialization
00044     osgScaleViewer::NodeFactory nodeFactory;
00045     if( !eq::init( argc, argv, &nodeFactory ))
00046     {
00047         std::cout << "Equalizer init failed" << std::endl;
00048         return EXIT_FAILURE;
00049     }
00050 
00051     // 2. parse arguments
00052     osgScaleViewer::InitData initData;
00053     if( !initData.parseCommandLine( argv, argc ))
00054         return -1;
00055 
00056     // 3. initialization of local client node
00057     co::base::RefPtr< osgScaleViewer::OSGScaleViewer > client =
00058         new osgScaleViewer::OSGScaleViewer( initData );
00059     if( !client->initLocal( argc, argv ))
00060     {
00061         EQERROR << "Can't init client" << std::endl;
00062         eq::exit();
00063         return EXIT_FAILURE;
00064     }
00065 
00066     // 4. run client
00067     const int ret = client->run();
00068 
00069     // 5. cleanup and exit
00070     client->exitLocal();
00071 
00072     EQASSERTINFO( client->getRefCount() == 1, "Client still referenced by " <<
00073                   client->getRefCount() - 1 );
00074     client = 0;
00075 
00076     eq::exit();
00077     return ret;
00078 }
Generated on Fri Jun 8 2012 15:44:31 for Equalizer 1.2.1 by  doxygen 1.8.0