application.h

Go to the documentation of this file.
00001 //=============================================================================
00016 #ifndef __APPLICATION_H_INCLUDED__
00017 #define __APPLICATION_H_INCLUDED__
00018 
00019 
00020 //=============================================================================
00021 // internal compile time configuration
00022 //=============================================================================
00023 
00024 #include "config.h"
00025 
00026 
00027 //=============================================================================
00028 //  including headers
00029 //=============================================================================
00030 
00031 // HACK HACK HACK:
00032 // if glee.h is included before this, Qt complains:
00033 // qt4/QtGui/qstyleoption.h:130: error: expected identifier before numeric constant
00034 // qt4/QtGui/qstyleoption.h:130: error: expected `}' before numeric constant
00035 // ...
00036 //
00037 #if ( CONFIG_USE_QTGUI != 0 )
00038 
00039 // this is for universal use and should work with all Qt versions.
00040 #include <QtGui/QtGui>
00041 
00042 #else
00043 
00044 // this is the 'fast compile' version, but seems to cause problems with some Qt versions.
00045 #include <QtCore/QMetaType>
00046 #include <QtCore/QDataStream>
00047 #include <QtCore/QString>
00048 #include <QtGui/QTextEdit>
00049 #include <QtGui/QComboBox>
00050 #include <QtGui/QMainWindow>
00051 #include <QtGui/QApplication>
00052 #endif
00053 
00054 
00055 //
00056 // the OpenGL "cross platform" graphics library.
00057 // -> Must be included after Qt (see above) but BEFORE gl/gl.h
00058 //    This is a big problem, because It must be included
00059 //    before the Qt OpenGL code.
00060 //
00061 #include "glee/GLee.h"
00062 
00063 
00064 //=============================================================================
00065 //  custom vertex attributes
00066 //=============================================================================
00067 
00073 class VertexAttribLocations
00074 {
00075 public:
00081     VertexAttribLocations( int Tangent=-1, int Bitangent=-1 )
00082         : tangent(Tangent), bitangent(Bitangent)
00083     {
00084     }
00085 
00088     inline int operator==( const VertexAttribLocations & other ) const
00089     {
00090         return  ( this->tangent     == other.tangent ) &&
00091                 ( this->bitangent   == other.bitangent );
00092     }
00093 
00096     inline int operator!=( const VertexAttribLocations & other ) const
00097     {
00098         return !( *this == other );
00099     }
00100 
00101     // tangent space basis vectors
00102     int tangent;    
00103     int bitangent;  
00104 };
00105 
00106 
00107 //=============================================================================
00108 //  useful macros
00109 //=============================================================================
00110 
00114 #define SAFE_DELETE(p)          do{  if( (p) != NULL ) { delete    (p); (p)=NULL; } } while(0)
00115 
00119 #define SAFE_DELETE_ARRAY(p)    do{  if( (p) != NULL ) { delete [] (p); (p)=NULL; } } while(0)
00120 
00121 
00122 //=============================================================================
00123 //  useful functions
00124 //=============================================================================
00125 
00135 extern QString extractFileNameFromPath( const QString & path );
00136 
00137 
00138 
00139 #endif  // __APPLICATION_H_INCLUDED__
00140 

Generated on Sun Mar 2 17:12:31 2008 for Shader Maker by  doxygen 1.5.4