- Main Page
- Namespaces
- Files

- File List

# setup.hpp

    00001
    00002 // OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
    00004 // Created : 2006-11-13
    00005 // Updated : 2010-01-28
    00006 // Licence : This source is under MIT License
    00007 // File    : glm/setup.hpp
    00009
    00010 #ifndef glm_setup
    00011 #define glm_setup
    00012
    00014 // Version
    00015
    00016 #define GLM_VERSION                                     90
    00017 #define GLM_VERSION_MAJOR                       0
    00018 #define GLM_VERSION_MINOR                       9
    00019 #define GLM_VERSION_PATCH                       0
    00020 #define GLM_VERSION_REVISION            4
    00021
    00023 // Common values
    00024
    00025 #define GLM_DISABLE                                     0x00000000
    00026 #define GLM_ENABLE                                      0x00000001
    00027
    00029 // Message
    00030
    00031 #define GLM_MESSAGE_QUIET                       0x00000000
    00032
    00033 #define GLM_MESSAGE_WARNING                     0x00000001
    00034 #define GLM_MESSAGE_NOTIFICATION        0x00000002
    00035 #define GLM_MESSAGE_CORE                        0x00000004
    00036 #define GLM_MESSAGE_EXTS                        0x00000008
    00037 #define GLM_MESSAGE_SETUP                       0x00000010
    00038
    00039 #define GLM_MESSAGE_ALL                         GLM_MESSAGE_WARNING | GLM_MESSAGE_NOTIFICATION | GLM_MESSAGE_CORE | GLM_MESSAGE_EXTS | GLM_MESSAGE_SETUP
    00040
    00042 // #define GLM_MESSAGE                          GLM_MESSAGE_QUIET
    00043
    00045 // Precision
    00046
    00047 #define GLM_PRECISION_NONE                      0x00000000
    00048
    00049 #define GLM_PRECISION_LOWP_FLOAT        0x00000011
    00050 #define GLM_PRECISION_MEDIUMP_FLOAT     0x00000012
    00051 #define GLM_PRECISION_HIGHP_FLOAT       0x00000013
    00052
    00053 #define GLM_PRECISION_LOWP_INT          0x00001100
    00054 #define GLM_PRECISION_MEDIUMP_INT       0x00001200
    00055 #define GLM_PRECISION_HIGHP_INT         0x00001300
    00056
    00057 #define GLM_PRECISION_LOWP_UINT         0x00110000
    00058 #define GLM_PRECISION_MEDIUMP_UINT      0x00120000
    00059 #define GLM_PRECISION_HIGHP_UINT        0x00130000
    00060
    00062 // Compiler
    00063
    00064 #define GLM_COMPILER_UNKNOWNED          0x00000000
    00065
    00066 // Visual C++ defines
    00067 #define GLM_COMPILER_VC                         0x01000000
    00068 #define GLM_COMPILER_VC2005                     0x01000010
    00069 #define GLM_COMPILER_VC2008                     0x01000020
    00070 #define GLM_COMPILER_VC2010                     0x01000040
    00071
    00072 // GCC defines
    00073 #define GLM_COMPILER_GCC            0x02000000
    00074 #define GLM_COMPILER_GCC32                      0x02000040
    00075 #define GLM_COMPILER_GCC33                      0x02000080
    00076 #define GLM_COMPILER_GCC34                      0x02000100
    00077 #define GLM_COMPILER_GCC35                      0x02000200
    00078 #define GLM_COMPILER_GCC40                      0x02000400
    00079 #define GLM_COMPILER_GCC41                      0x02000800
    00080 #define GLM_COMPILER_GCC42                      0x02001000
    00081 #define GLM_COMPILER_GCC43                      0x02002000
    00082 #define GLM_COMPILER_GCC44                      0x02004000
    00083 #define GLM_COMPILER_GCC45                      0x02008000
    00084 #define GLM_COMPILER_GCC46                      0x02010000
    00085 #define GLM_COMPILER_GCC50                      0x02020000
    00086
    00087 // Borland C++ defines. How to identify BC?
    00088 #define GLM_COMPILER_BC                         0x03000000
    00089 #define GLM_COMPILER_BCB4                       0x03000400
    00090 #define GLM_COMPILER_BCB5                       0x03000800
    00091 #define GLM_COMPILER_BCB6                       0x03001000
    00092 //#define GLM_COMPILER_BCBX                     0x03002000 // What's the version value?
    00093 #define GLM_COMPILER_BCB2009            0x03004000
    00094
    00095 #define GLM_MODEL_32                            0x00000010
    00096 #define GLM_MODEL_64                            0x00000020
    00097
    00098 #ifndef GLM_COMPILER
    00099
    00100 // CodeWarrior
    00101 #define GLM_COMPILER_CODEWARRIOR        0x04000000
    00102
    00104 // Visual C++ //
    00105
    00106 #ifdef _MSC_VER
    00107
    00108 #if defined(_WIN64)
    00109 #define GLM_MODEL       GLM_MODEL_64
    00110 #else
    00111 #define GLM_MODEL       GLM_MODEL_32
    00112 #endif//_WIN64
    00113
    00114 #if _MSC_VER == 1400
    00115 #define GLM_COMPILER GLM_COMPILER_VC2005
    00116 #elif _MSC_VER == 1500
    00117 #define GLM_COMPILER GLM_COMPILER_VC2008
    00118 #elif _MSC_VER == 1600
    00119 #define GLM_COMPILER GLM_COMPILER_VC2010
    00120 #else//_MSC_VER
    00121 #define GLM_COMPILER GLM_COMPILER_VC
    00122 #endif//_MSC_VER
    00123
    00125 // GCC defines //
    00126
    00127 #elif defined(__GNUC__)
    00128
    00129 #if(defined(__WORDSIZE) && (__WORDSIZE == 64)) || defined(__arch64__)
    00130 #define GLM_MODEL       GLM_MODEL_64
    00131 #else
    00132 #define GLM_MODEL       GLM_MODEL_32
    00133 #endif//
    00134
    00135 #if   (__GNUC__ == 3) && (__GNUC_MINOR__ == 2)
    00136 #define GLM_COMPILER GLM_COMPILER_GCC32
    00137 #elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 3)
    00138 #define GLM_COMPILER GLM_COMPILER_GCC33
    00139 #elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 4)
    00140 #define GLM_COMPILER GLM_COMPILER_GCC34
    00141 #elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 5)
    00142 #define GLM_COMPILER GLM_COMPILER_GCC35
    00143 #elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 0)
    00144 #define GLM_COMPILER GLM_COMPILER_GCC40
    00145 #elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 1)
    00146 #define GLM_COMPILER GLM_COMPILER_GCC41
    00147 #elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
    00148 #define GLM_COMPILER GLM_COMPILER_GCC42
    00149 #elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
    00150 #define GLM_COMPILER GLM_COMPILER_GCC43
    00151 #elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 4)
    00152 #define GLM_COMPILER GLM_COMPILER_GCC44
    00153 #elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 5)
    00154 #define GLM_COMPILER GLM_COMPILER_GCC45
    00155 #elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)
    00156 #define GLM_COMPILER GLM_COMPILER_GCC46
    00157 #elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 0)
    00158 #define GLM_COMPILER GLM_COMPILER_GCC50
    00159 #else
    00160 #define GLM_COMPILER GLM_COMPILER_GCC
    00161 #endif
    00162
    00163 #elif defined(_BORLANDC_)
    00164
    00165 #if defined(VER125)
    00166 #define GLM_COMPILER GLM_COMPILER_BCB4
    00167 #elif defined(VER130)
    00168 #define GLM_COMPILER GLM_COMPILER_BCB5
    00169 #elif defined(VER140)
    00170 #define GLM_COMPILER GLM_COMPILER_BCB6
    00171 #elif defined(VER200)
    00172 #define GLM_COMPILER GLM_COMPILER_BCB2009
    00173 #else
    00174 #define GLM_COMPILER GLM_COMPILER_BC
    00175 #endif
    00176
    00177 #elif defined(__MWERKS__)
    00178
    00179 #define GLM_COMPILER GLM_COMPILER_CODEWARRIOR
    00180
    00181 #else
    00182 #define GLM_COMPILER GLM_COMPILER_UNKNOWNED
    00183 #endif//__GNUC__
    00184
    00185 #endif//GLM_COMPILER
    00186
    00187 #ifndef GLM_COMPILER
    00188 #error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message."
    00189 #endif//GLM_COMPILER
    00190
    00191 #if(!defined(GLM_MODEL) && GLM_COMPILER != 0)
    00192 #error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message."
    00193 #endif//GLM_MODEL
    00194
    00195 #if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))
    00196 #       if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC)
    00197 #               pragma message("GLM message: Compiled with Visual C++")
    00198 #       elif(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_GCC)
    00199 #               pragma message("GLM message: Compiled with GCC")
    00200 #       else
    00201 #               pragma message("GLM warning: Compiler not detected")
    00202 #       endif
    00203 #endif//GLM_MESSAGE
    00204
    00205 #if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))
    00206 #       if(GLM_MODEL == GLM_MODEL_64)
    00207 #               pragma message("GLM message: 64 bits model")
    00208 #       elif(GLM_MODEL == GLM_MODEL_32)
    00209 #               pragma message("GLM message: 32 bits model")
    00210 #       endif//GLM_MODEL
    00211 #endif//GLM_MESSAGE
    00212
    00214 // Swizzle operators
    00215
    00216 #define GLM_SWIZZLE_NONE            0x00000000
    00217 #define GLM_SWIZZLE_XYZW            0x00000002
    00218 #define GLM_SWIZZLE_RGBA            0x00000004
    00219 #define GLM_SWIZZLE_STQP            0x00000008
    00220 #define GLM_SWIZZLE_FULL            (GLM_SWIZZLE_XYZW | GLM_SWIZZLE_RGBA | GLM_SWIZZLE_STQP)
    00221
    00223 // #define GLM_SWIZZLE GLM_SWIZZLE_NONE
    00224
    00225 #if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))
    00226 #       if !defined(GLM_SWIZZLE)|| (defined(GLM_SWIZZLE) && GLM_SWIZZLE == GLM_SWIZZLE_NONE)
    00227 #               pragma message("GLM message: No swizzling operator used")
    00228 #       elif(defined(GLM_SWIZZLE) && GLM_SWIZZLE == GLM_SWIZZLE_FULL)
    00229 #               pragma message("GLM message: Full swizzling operator support enabled")
    00230 #       elif(defined(GLM_SWIZZLE) && GLM_SWIZZLE & GLM_SWIZZLE_FULL)
    00231 #               pragma message("GLM message: Partial swizzling operator support enabled")
    00232 #       endif//GLM_SWIZZLE
    00233 #endif//GLM_MESSAGE
    00234
    00236 // Use options
    00237
    00238 // To disable multiple vector component names access.
    00239 // GLM_USE_ONLY_XYZW
    00240
    00241 // To use anonymous union to provide multiple component names access for class valType. Visual C++ only.
    00242 // GLM_USE_ANONYMOUS_UNION
    00243
    00244 #if(defined(GLM_USE_ANONYMOUS_UNION) && !(GLM_COMPILER & GLM_COMPILER_VC))
    00245 #error "GLM_USE_ANONYMOUS_UNION is defined to use anonymous union implementation of vector types. Anonymous unions can't be used with GCC."
    00246 #endif//GLM_USE_ANONYMOUS_UNION
    00247
    00249 // Static assert
    00250
    00251 #if(defined(BOOST_STATIC_ASSERT))
    00252 #define GLM_STATIC_ASSERT(x) BOOST_STATIC_ASSERT(x)
    00253 #else
    00254 #define GLM_STATIC_ASSERT(x) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
    00255 #endif//GLM_DEPENDENCE
    00256
    00258
    00259 #endif//glm_setup