- Main Page
- Namespaces
- Files

- File List

# setup.hpp

    00001
    00002 // OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)
    00004 // Created : 2006-11-13
    00005 // Updated : 2009-08-24
    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                                     84
    00017 #define GLM_REVISION                            724
    00018
    00020 // Common values
    00021
    00022 #define GLM_DISABLE                                     0x00000000
    00023 #define GLM_ENABLE                                      0x00000001
    00024
    00026 // Message
    00027
    00028 #define GLM_MESSAGE_QUIET                       0x00000000
    00029
    00030 #define GLM_MESSAGE_WARNING                     0x00000001
    00031 #define GLM_MESSAGE_NOTIFICATION        0x00000002
    00032 #define GLM_MESSAGE_CORE                        0x00000004
    00033 #define GLM_MESSAGE_EXTS                        0x00000008
    00034 #define GLM_MESSAGE_SETUP                       0x00000010
    00035
    00036 #define GLM_MESSAGE_ALL                         GLM_MESSAGE_WARNING | GLM_MESSAGE_NOTIFICATION | GLM_MESSAGE_CORE | GLM_MESSAGE_EXTS | GLM_MESSAGE_SETUP
    00037
    00039 // #define GLM_MESSAGE GLM_MESSAGE_QUIET
    00040
    00042 // Precision
    00043
    00044 #define GLM_PRECISION_NONE                      0x00000000
    00045
    00046 #define GLM_PRECISION_LOWP_FLOAT        0x00000011
    00047 #define GLM_PRECISION_MEDIUMP_FLOAT     0x00000012
    00048 #define GLM_PRECISION_HIGHP_FLOAT       0x00000013
    00049
    00050 #define GLM_PRECISION_LOWP_INT          0x00001100
    00051 #define GLM_PRECISION_MEDIUMP_INT       0x00001200
    00052 #define GLM_PRECISION_HIGHP_INT         0x00001300
    00053
    00054 #define GLM_PRECISION_LOWP_UINT         0x00110000
    00055 #define GLM_PRECISION_MEDIUMP_UINT      0x00120000
    00056 #define GLM_PRECISION_HIGHP_UINT        0x00130000
    00057
    00059 // Use options
    00060
    00061 // To disable multiple vector component names access.
    00062 // GLM_USE_ONLY_XYZW
    00063
    00064 // To use anonymous union to provide multiple component names access for class valType. Visual C++ only.
    00065 // GLM_USE_ANONYMOUS_UNION
    00066
    00068 // Compiler
    00069
    00070 #define GLM_COMPILER_NONE                       0x00000000
    00071
    00072 // Visual C++ defines
    00073 #define GLM_COMPILER_VC                         0x01000000
    00074 #define GLM_COMPILER_VC60                       0x01000040 // unsupported
    00075 #define GLM_COMPILER_VC70                       0x01000080 // unsupported
    00076 #define GLM_COMPILER_VC71                       0x01000100 // unsupported
    00077 #define GLM_COMPILER_VC80                       0x01000200
    00078 #define GLM_COMPILER_VC90                       0x01000400
    00079 #define GLM_COMPILER_VC2010                     0x01000800
    00080
    00081 // GCC defines
    00082 #define GLM_COMPILER_GCC            0x02000000
    00083 #define GLM_COMPILER_GCC28                      0x02000020 // unsupported
    00084 #define GLM_COMPILER_GCC29                      0x02000040 // unsupported
    00085 #define GLM_COMPILER_GCC30                      0x02000080 // unsupported
    00086 #define GLM_COMPILER_GCC31                      0x02000100 // unsupported
    00087 #define GLM_COMPILER_GCC32                      0x02000200
    00088 #define GLM_COMPILER_GCC33                      0x02000400
    00089 #define GLM_COMPILER_GCC34                      0x02000800
    00090 #define GLM_COMPILER_GCC35                      0x02001000
    00091 #define GLM_COMPILER_GCC40                      0x02002000
    00092 #define GLM_COMPILER_GCC41                      0x02004000
    00093 #define GLM_COMPILER_GCC42                      0x02008000
    00094 #define GLM_COMPILER_GCC43                      0x02010000
    00095 #define GLM_COMPILER_GCC44                      0x02020000
    00096 #define GLM_COMPILER_GCC45                      0x02040000
    00097 #define GLM_COMPILER_GCC46                      0x02080000
    00098 #define GLM_COMPILER_GCC50                      0x0210000
    00099
    00100 #define GLM_MODEL_32                            0x00000010
    00101 #define GLM_MODEL_64                            0x00000020
    00102
    00103 #ifndef GLM_COMPILER
    00104
    00106 // Visual C++ //
    00107
    00108 #ifdef _MSC_VER
    00109
    00110 #if defined(_WIN64)
    00111 #define GLM_MODEL       GLM_MODEL_64
    00112 #else
    00113 #define GLM_MODEL       GLM_MODEL_32
    00114 #endif//
    00115
    00116 #if _MSC_VER == 1200
    00117 #define GLM_COMPILER GLM_COMPILER_VC60
    00118 #endif
    00119
    00120 #if _MSC_VER == 1300
    00121 #define GLM_COMPILER GLM_COMPILER_VC70
    00122 #endif
    00123
    00124 #if _MSC_VER == 1310
    00125 #define GLM_COMPILER GLM_COMPILER_VC71
    00126 #endif
    00127
    00128 #if _MSC_VER == 1400
    00129 #define GLM_COMPILER GLM_COMPILER_VC80
    00130 #endif
    00131
    00132 #if _MSC_VER == 1500
    00133 #define GLM_COMPILER GLM_COMPILER_VC90
    00134 #endif
    00135
    00136 #if _MSC_VER == 1600
    00137 #define GLM_COMPILER GLM_COMPILER_VC2010
    00138 #endif
    00139
    00140 #endif//_MSC_VER
    00141
    00143 // GCC defines //
    00144
    00145 #ifdef __GNUC__
    00146
    00147 #if(defined(__WORDSIZE) && (__WORDSIZE == 64)) || defined(__arch64__)
    00148 #define GLM_MODEL       GLM_MODEL_64
    00149 #else
    00150 #define GLM_MODEL       GLM_MODEL_32
    00151 #endif//
    00152
    00153 #if (__GNUC__ == 2) && (__GNUC_MINOR__ == 8)
    00154 #error "GCC 2.8x isn't supported"
    00155 #define GLM_COMPILER GLM_COMPILER_GCC28
    00156 #endif
    00157
    00158 #if (__GNUC__ == 2) && (__GNUC_MINOR__ == 9)
    00159 #error "GCC 2.9x isn't supported"
    00160 #define GLM_COMPILER GLM_COMPILER_GCC29
    00161 #endif
    00162
    00163 #if (__GNUC__ == 3) && (__GNUC_MINOR__ == 0)
    00164 #error "GCC 3.0 isn't supported"
    00165 #define GLM_COMPILER GLM_COMPILER_GCC30
    00166 #endif
    00167
    00168 #if (__GNUC__ == 3) && (__GNUC_MINOR__ == 1)
    00169 #error "GCC 3.1 isn't supported"
    00170 #define GLM_COMPILER GLM_COMPILER_GCC31
    00171 #endif
    00172
    00173 #if (__GNUC__ == 3) && (__GNUC_MINOR__ == 2)
    00174 #define GLM_COMPILER GLM_COMPILER_GCC32
    00175 #endif
    00176
    00177 #if (__GNUC__ == 3) && (__GNUC_MINOR__ == 3)
    00178 #define GLM_COMPILER GLM_COMPILER_GCC33
    00179 #endif
    00180
    00181 #if (__GNUC__ == 3) && (__GNUC_MINOR__ == 4)
    00182 #define GLM_COMPILER GLM_COMPILER_GCC34
    00183 #endif
    00184
    00185 #if (__GNUC__ == 3) && (__GNUC_MINOR__ == 5)
    00186 #define GLM_COMPILER GLM_COMPILER_GCC35
    00187 #endif
    00188
    00189 #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 0)
    00190 #define GLM_COMPILER GLM_COMPILER_GCC40
    00191 #endif
    00192
    00193 #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 1)
    00194 #define GLM_COMPILER GLM_COMPILER_GCC41
    00195 #endif
    00196
    00197 #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
    00198 #define GLM_COMPILER GLM_COMPILER_GCC42
    00199 #endif
    00200
    00201 #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
    00202 #define GLM_COMPILER GLM_COMPILER_GCC43
    00203 #endif
    00204
    00205 #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 4)
    00206 #define GLM_COMPILER GLM_COMPILER_GCC44
    00207 #endif
    00208
    00209 #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 5)
    00210 #define GLM_COMPILER GLM_COMPILER_GCC45
    00211 #endif
    00212
    00213 #if (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)
    00214 #define GLM_COMPILER GLM_COMPILER_GCC46
    00215 #endif
    00216
    00217 #if (__GNUC__ == 5) && (__GNUC_MINOR__ == 0)
    00218 #define GLM_COMPILER GLM_COMPILER_GCC50
    00219 #endif
    00220
    00221 #endif//__GNUC__
    00222
    00223 #endif//GLM_COMPILER
    00224
    00225 #ifndef GLM_COMPILER
    00226 #error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message."
    00227 #endif//GLM_COMPILER
    00228
    00229 #if(!defined(GLM_MODEL) && GLM_COMPILER != 0)
    00230 #error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message."
    00231 #endif//GLM_MODEL
    00232
    00233 #if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))
    00234 #       if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC)
    00235 #               pragma message("GLM message: Compiled with Visual C++")
    00236 #       elif(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_GCC)
    00237 #               pragma message("GLM message: Compiled with GCC")
    00238 #       else
    00239 #               pragma message("GLM warning: Compiler not detected")
    00240 #       endif
    00241 #endif//GLM_MESSAGE
    00242
    00243 #if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))
    00244 #       if(GLM_MODEL == GLM_MODEL_64)
    00245 #               pragma message("GLM message: 64 bits model")
    00246 #       elif(GLM_MODEL == GLM_MODEL_32)
    00247 #               pragma message("GLM message: 32 bits model")
    00248 #       endif//GLM_MODEL
    00249 #endif//GLM_MESSAGE
    00250
    00252 // Compatibility
    00253
    00254 #define GLM_COMPATIBILITY_DEFAULT       0
    00255 #define GLM_COMPATIBILITY_STRICT        1
    00256
    00258 //#define GLM_COMPATIBILITY                     GLM_COMPATIBILITY_DEFAULT
    00259
    00260 #if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))
    00261 #       if(!defined(GLM_COMPATIBILITY) || (defined(GLM_COMPATIBILITY) && (GLM_COMPATIBILITY == GLM_COMPATIBILITY_STRICT)))
    00262 #
    00263 #       elif(defined(GLM_COMPATIBILITY) && (GLM_COMPATIBILITY == GLM_COMPATIBILITY_STRICT))
    00264 #               pragma message("GLM message: compatibility strict")
    00265 #       endif//GLM_AUTO_CAST
    00266 #endif//GLM_MESSAGE
    00267
    00269 // External dependencies
    00270
    00271 #define GLM_DEPENDENCE_NONE                     0x00000000
    00272 #define GLM_DEPENDENCE_GLEW                     0x00000001
    00273 #define GLM_DEPENDENCE_GLEE                     0x00000002
    00274 #define GLM_DEPENDENCE_GL                       0x00000004
    00275 #define GLM_DEPENDENCE_GL3                      0x00000008
    00276 #define GLM_DEPENDENCE_BOOST            0x00000010
    00277 #define GLM_DEPENDENCE_STL                      0x00000020
    00278 #define GLM_DEPENDENCE_TR1                      0x00000040
    00279 #define GLM_DEPENDENCE_TR2                      0x00000080
    00280
    00282 // #define GLM_DEPENDENCE GLM_DEPENDENCE_NONE
    00283
    00284 #if(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_GLEW))
    00285 #include <GL/glew.hpp>
    00286 #elif(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_GLEE))
    00287 #include <GL/GLee.hpp>
    00288 #elif(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_GL))
    00289 #include <GL/gl.h>
    00290 #elif(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_GL3))
    00291 #include <GL3/gl3.h>
    00292 #endif//GLM_DEPENDENCE
    00293
    00294 #if(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_BOOST))
    00295 #include <boost/static_assert.hpp>
    00296 #endif//GLM_DEPENDENCE
    00297
    00298 #if(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_BOOST)) || defined(BOOST_STATIC_ASSERT)
    00299 #define GLM_STATIC_ASSERT(x) BOOST_STATIC_ASSERT(x)
    00300 #else
    00301 #define GLM_STATIC_ASSERT(x) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
    00302 #endif//GLM_DEPENDENCE
    00303
    00305 // Cast
    00306
    00307 #define GLM_CAST_NONE                           0x00000000
    00308 #define GLM_CAST_DIRECTX_9                      0x00000001
    00309 #define GLM_CAST_DIRECTX_10                     0x00000002
    00310 #define GLM_CAST_NVSG                           0x00000004
    00311 #define GLM_CAST_WILD_MAGIC_3           0x00000008
    00312 #define GLM_CAST_WILD_MAGIC_4           0x00000010
    00313 #define GLM_CAST_PHYSX                          0x00000020
    00314 #define GLM_CAST_ODE                            0x00000040
    00315
    00317 // #define GLM_CAST     GLM_CAST_NONE
    00318 // #define GLM_CAST_EXT GLM_CAST_NONE
    00319
    00321 // Automatic cast
    00322 // glColor4fv(glm::vec4(1.0))
    00323
    00325 // #define GLM_AUTO_CAST                        GLM_ENABLE
    00326
    00327 // GLM_AUTO_CAST isn't defined by defaut but also enable by default with GLM 0.7.x
    00328 // Disable GLM_AUTO_CAST by default on Visual C++ 7.1
    00329 #if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC && GLM_COMPILER <= GLM_COMPILER_VC71)
    00330 #       if(defined(GLM_AUTO_CAST) || (GLM_AUTO_CAST == GLM_ENABLE))
    00331 #               error "GLM_AUTO_CAST isn't supported by Visual C++ 7.1 and below"
    00332 #       else
    00333 #               define GLM_AUTO_CAST GLM_DISABLE
    00334 #       endif//GLM_AUTO_CAST
    00335 #endif//GLM_COMPILER
    00336
    00337 #if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))
    00338 #       if(!defined(GLM_AUTO_CAST) || (defined(GLM_AUTO_CAST) && (GLM_AUTO_CAST == GLM_ENABLE)))
    00339 #               pragma message("GLM message: Auto cast enabled")
    00340 #       else
    00341 #               pragma message("GLM message: Auto cast disabled")
    00342 #       endif//GLM_AUTO_CAST
    00343 #endif//GLM_MESSAGE
    00344
    00346 // Swizzle operators
    00347
    00348 #define GLM_SWIZZLE_NONE            0x00000000
    00349 #define GLM_SWIZZLE_XYZW            0x00000002
    00350 #define GLM_SWIZZLE_RGBA            0x00000004
    00351 #define GLM_SWIZZLE_STQP            0x00000008
    00352 #define GLM_SWIZZLE_FULL            (GLM_SWIZZLE_XYZW | GLM_SWIZZLE_RGBA | GLM_SWIZZLE_STQP)
    00353
    00355 // #define GLM_SWIZZLE GLM_SWIZZLE_NONE
    00356
    00357 #if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))
    00358 #       if !defined(GLM_SWIZZLE)|| (defined(GLM_SWIZZLE) && GLM_SWIZZLE == GLM_SWIZZLE_NONE)
    00359 #               pragma message("GLM message: No swizzling operator used")
    00360 #       elif(defined(GLM_SWIZZLE) && GLM_SWIZZLE == GLM_SWIZZLE_FULL)
    00361 #               pragma message("GLM message: Full swizzling operator support enabled")
    00362 #       elif(defined(GLM_SWIZZLE) && GLM_SWIZZLE & GLM_SWIZZLE_FULL)
    00363 #               pragma message("GLM message: Partial swizzling operator support enabled")
    00364 #       endif//GLM_SWIZZLE
    00365 #endif//GLM_MESSAGE
    00366
    00368
    00369 #endif//glm_setup