About.cc

00001 /*===========================================================================*\
00002  *                                                                           *
00003  *                              OpenFlipper                                  *
00004  *      Copyright (C) 2001-2009 by Computer Graphics Group, RWTH Aachen      *
00005  *                           www.openflipper.org                             *
00006  *                                                                           *
00007  *---------------------------------------------------------------------------*
00008  *  This file is part of OpenFlipper.                                        *
00009  *                                                                           *
00010  *  OpenFlipper is free software: you can redistribute it and/or modify      *
00011  *  it under the terms of the GNU Lesser General Public License as           *
00012  *  published by the Free Software Foundation, either version 3 of           *
00013  *  the License, or (at your option) any later version with the              *
00014  *  following exceptions:                                                    *
00015  *                                                                           *
00016  *  If other files instantiate templates or use macros                       *
00017  *  or inline functions from this file, or you compile this file and         *
00018  *  link it with other files to produce an executable, this file does        *
00019  *  not by itself cause the resulting executable to be covered by the        *
00020  *  GNU Lesser General Public License. This exception does not however       *
00021  *  invalidate any other reasons why the executable file might be            *
00022  *  covered by the GNU Lesser General Public License.                        *
00023  *                                                                           *
00024  *  OpenFlipper is distributed in the hope that it will be useful,           *
00025  *  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
00026  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            *
00027  *  GNU Lesser General Public License for more details.                      *
00028  *                                                                           *
00029  *  You should have received a copy of the GNU LesserGeneral Public          *
00030  *  License along with OpenFlipper. If not,                                  *
00031  *  see <http://www.gnu.org/licenses/>.                                      *
00032  *                                                                           *
00033 \*===========================================================================*/
00034 
00035 /*===========================================================================*\
00036  *                                                                           *
00037  *   $Revision: 8520 $                                                         *
00038  *   $Author: moebius $                                                      *
00039  *   $Date: 2010-02-10 15:56:59 +0100 (Mi, 10. Feb 2010) $                   *
00040  *                                                                           *
00041 \*===========================================================================*/
00042 
00043 
00044 
00045 
00046 //=============================================================================
00047 //
00048 //  CLASS Core - IMPLEMENTATION
00049 //
00050 //=============================================================================
00051 
00052 
00053 //== INCLUDES =================================================================
00054 
00055 #include "CoreWidget.hh"
00056 
00057 #include <QGLFormat>
00058 
00059 #include <OpenFlipper/common/GlobalOptions.hh>
00060 
00061 //== IMPLEMENTATION ==========================================================
00062 
00063 
00064 
00065 void CoreWidget::showAboutWidget( ) {
00066 
00067   if ( OpenFlipper::Options::nogui() )
00068     return;
00069 
00070   if ( aboutWidget_ == 0 ) {
00071     aboutWidget_ = new AboutWidget( this );
00072     aboutWidget_->OpenFlipperAbout->append(tr("OpenFlipper Core Version: ") + OpenFlipper::Options::coreVersion() ) ;
00073 
00074     // =====================================================================================
00075     // Directory info
00076     // =====================================================================================
00077     aboutWidget_->OpenFlipperAbout->append("\n");
00078     aboutWidget_->OpenFlipperAbout->append(tr("OpenFlipper Directories:"));
00079     
00080     // Get the dataDir
00081     QDir tempDir = QDir(OpenFlipper::Options::applicationDir());
00082     #ifdef OPENFLIPPER_DATADIR
00083       tempDir.cd(OPENFLIPPER_DATADIR);
00084     #endif
00085     aboutWidget_->OpenFlipperAbout->append("Data:\t " + tempDir.absolutePath() );
00086     aboutWidget_->OpenFlipperAbout->append("Shaders:\t " + OpenFlipper::Options::shaderDirStr() );
00087     aboutWidget_->OpenFlipperAbout->append("Textures:\t " + OpenFlipper::Options::textureDirStr() );
00088     aboutWidget_->OpenFlipperAbout->append("Scripts:\t " + OpenFlipper::Options::scriptDirStr() );
00089     aboutWidget_->OpenFlipperAbout->append("Icons:\t " + OpenFlipper::Options::iconDirStr() );
00090     aboutWidget_->OpenFlipperAbout->append("Fonts:\t" + OpenFlipper::Options::fontsDirStr() );
00091     aboutWidget_->OpenFlipperAbout->append("Help:\t" + OpenFlipper::Options::helpDirStr() );
00092 
00093     // =====================================================================================
00094     // OpenGL Renderer/Vendor and version info
00095     // =====================================================================================    
00096     aboutWidget_->OpenFlipperAbout->append("\n");
00097     aboutWidget_->OpenFlipperAbout->append(tr("OpenGL Specific Info:"));
00098 
00099 
00100     QString vendor = QString((const char*)glGetString(GL_VENDOR));
00101     aboutWidget_->OpenFlipperAbout->append(tr("Vendor:\t") + vendor);
00102     QString renderer = QString((const char*)glGetString(GL_RENDERER));
00103     aboutWidget_->OpenFlipperAbout->append(tr("Renderer:\t") + renderer);
00104 
00105     QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
00106 
00107     if ( flags.testFlag(QGLFormat::OpenGL_Version_3_0) )
00108       aboutWidget_->OpenFlipperAbout->append(tr("Version:\t3.0 or higher") );
00109     else if (flags.testFlag(QGLFormat::OpenGL_Version_2_1))
00110       aboutWidget_->OpenFlipperAbout->append(tr("Version:\t2.1 or higher" ));
00111     else if (flags.testFlag(QGLFormat::OpenGL_Version_2_0))
00112       aboutWidget_->OpenFlipperAbout->append(tr("Version:\t2.0 or higher" ));
00113     else if (flags.testFlag(QGLFormat::OpenGL_Version_1_5))
00114       aboutWidget_->OpenFlipperAbout->append(tr("Version:\t1.5 or higher" ));
00115     else if (flags.testFlag(QGLFormat::OpenGL_Version_1_4))
00116       aboutWidget_->OpenFlipperAbout->append(tr("Version:\t1.4 or higher" ));
00117     else if (flags.testFlag(QGLFormat::OpenGL_Version_1_3))
00118       aboutWidget_->OpenFlipperAbout->append(tr("Version:\t1.3 or higher" ));
00119     else if (flags.testFlag(QGLFormat::OpenGL_Version_1_2))
00120       aboutWidget_->OpenFlipperAbout->append(tr("Version:\t1.2 or higher" ));
00121     else if (flags.testFlag(QGLFormat::OpenGL_Version_1_1))
00122       aboutWidget_->OpenFlipperAbout->append(tr("Version:\t1.1 or higher" ));
00123     else
00124       aboutWidget_->OpenFlipperAbout->append(tr("Version:\tUNKNOWN!" ));
00125 
00126 
00127 
00128     // =====================================================================================
00129     // OpenGL Extensions
00130     // =====================================================================================
00131     aboutWidget_->OpenFlipperAbout->append(tr("Supported Extensions:"));
00132     QString glExtensions = QString((const char*)glGetString(GL_EXTENSIONS));
00133     aboutWidget_->OpenFlipperAbout->append(glExtensions);
00134 
00135     aboutWidget_->OpenFlipperAbout->moveCursor(QTextCursor::Start);
00136     
00137     // =====================================================================================
00138     // Qt information
00139     // =====================================================================================
00140     
00141     aboutWidget_->OpenFlipperAbout->append("\n");
00142     aboutWidget_->OpenFlipperAbout->append(tr("Qt Version Info:"));
00143     aboutWidget_->OpenFlipperAbout->append(tr("Currently used Version:\t") + qVersion() );
00144     aboutWidget_->OpenFlipperAbout->append(tr("Link time Version:\t\t") + QT_VERSION_STR );
00145     
00146     // =====================================================================================
00147     // Compiler information
00148     // =====================================================================================    
00149     aboutWidget_->OpenFlipperAbout->append("\n");
00150     aboutWidget_->OpenFlipperAbout->append(tr("Compiler Version Info:"));
00151     aboutWidget_->OpenFlipperAbout->append( OpenFlipper::Options::compilerInfo() );
00152     
00153     // =====================================================================================
00154     // List the currently registered data types
00155     // =====================================================================================
00156     aboutWidget_->OpenFlipperAbout->append("\n");
00157     aboutWidget_->OpenFlipperAbout->append(tr("Registered data types:"));
00158 
00159     QString types;
00160 
00161     // Iterate over all Types known to the core
00162     // Start at 1:
00163     // 0 type is defined as DATA_UNKNOWN
00164     DataType currentType = 1;
00165     for ( uint i = 0 ; i < typeCount() - 2  ; ++i) {
00166       types += typeName( currentType ) + " ";
00167       
00168       // Advance to next type ( Indices are bits so multiply by to to get next bit)
00169       currentType++;
00170     }
00171     
00172     aboutWidget_->OpenFlipperAbout->append( types );
00173 
00174   }
00175 
00176   aboutWidget_->show();
00177 
00178 }
00179 //=============================================================================

acg pic Project OpenFlipper, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .