2010-04-29 10:54:07 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2010-04-29 10:56:52 +00:00
|
|
|
// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
|
2010-04-29 10:54:07 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Created : 2006-11-13
|
2010-04-29 10:56:52 +00:00
|
|
|
// Updated : 2010-01-28
|
2010-04-29 10:54:07 +00:00
|
|
|
// Licence : This source is under MIT License
|
|
|
|
// File : glm/setup.hpp
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef glm_setup
|
|
|
|
#define glm_setup
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Version
|
|
|
|
|
2010-04-29 10:56:52 +00:00
|
|
|
#define GLM_VERSION 90
|
|
|
|
#define GLM_VERSION_MAJOR 0
|
|
|
|
#define GLM_VERSION_MINOR 9
|
2010-05-23 20:33:42 +00:00
|
|
|
#define GLM_VERSION_PATCH 0
|
2010-06-20 23:17:28 +00:00
|
|
|
#define GLM_VERSION_REVISION 1
|
2010-04-29 10:54:07 +00:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Common values
|
|
|
|
|
|
|
|
#define GLM_DISABLE 0x00000000
|
|
|
|
#define GLM_ENABLE 0x00000001
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Message
|
|
|
|
|
|
|
|
#define GLM_MESSAGE_QUIET 0x00000000
|
|
|
|
|
|
|
|
#define GLM_MESSAGE_WARNING 0x00000001
|
|
|
|
#define GLM_MESSAGE_NOTIFICATION 0x00000002
|
|
|
|
#define GLM_MESSAGE_CORE 0x00000004
|
|
|
|
#define GLM_MESSAGE_EXTS 0x00000008
|
|
|
|
#define GLM_MESSAGE_SETUP 0x00000010
|
|
|
|
|
|
|
|
#define GLM_MESSAGE_ALL GLM_MESSAGE_WARNING | GLM_MESSAGE_NOTIFICATION | GLM_MESSAGE_CORE | GLM_MESSAGE_EXTS | GLM_MESSAGE_SETUP
|
|
|
|
|
|
|
|
//! By default:
|
2010-04-29 10:56:52 +00:00
|
|
|
// #define GLM_MESSAGE GLM_MESSAGE_QUIET
|
2010-04-29 10:54:07 +00:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Precision
|
|
|
|
|
|
|
|
#define GLM_PRECISION_NONE 0x00000000
|
|
|
|
|
|
|
|
#define GLM_PRECISION_LOWP_FLOAT 0x00000011
|
|
|
|
#define GLM_PRECISION_MEDIUMP_FLOAT 0x00000012
|
|
|
|
#define GLM_PRECISION_HIGHP_FLOAT 0x00000013
|
|
|
|
|
|
|
|
#define GLM_PRECISION_LOWP_INT 0x00001100
|
|
|
|
#define GLM_PRECISION_MEDIUMP_INT 0x00001200
|
|
|
|
#define GLM_PRECISION_HIGHP_INT 0x00001300
|
|
|
|
|
|
|
|
#define GLM_PRECISION_LOWP_UINT 0x00110000
|
|
|
|
#define GLM_PRECISION_MEDIUMP_UINT 0x00120000
|
|
|
|
#define GLM_PRECISION_HIGHP_UINT 0x00130000
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Compiler
|
|
|
|
|
2010-04-29 10:56:52 +00:00
|
|
|
#define GLM_COMPILER_UNKNOWNED 0x00000000
|
2010-04-29 10:54:07 +00:00
|
|
|
|
|
|
|
// Visual C++ defines
|
|
|
|
#define GLM_COMPILER_VC 0x01000000
|
2010-04-29 10:56:52 +00:00
|
|
|
#define GLM_COMPILER_VC2005 0x01000010
|
|
|
|
#define GLM_COMPILER_VC2008 0x01000020
|
|
|
|
#define GLM_COMPILER_VC2010 0x01000040
|
2010-04-29 10:54:07 +00:00
|
|
|
|
|
|
|
// GCC defines
|
|
|
|
#define GLM_COMPILER_GCC 0x02000000
|
2010-04-29 10:56:52 +00:00
|
|
|
#define GLM_COMPILER_GCC32 0x02000040
|
|
|
|
#define GLM_COMPILER_GCC33 0x02000080
|
|
|
|
#define GLM_COMPILER_GCC34 0x02000100
|
|
|
|
#define GLM_COMPILER_GCC35 0x02000200
|
|
|
|
#define GLM_COMPILER_GCC40 0x02000400
|
|
|
|
#define GLM_COMPILER_GCC41 0x02000800
|
|
|
|
#define GLM_COMPILER_GCC42 0x02001000
|
|
|
|
#define GLM_COMPILER_GCC43 0x02002000
|
|
|
|
#define GLM_COMPILER_GCC44 0x02004000
|
|
|
|
#define GLM_COMPILER_GCC45 0x02008000
|
|
|
|
#define GLM_COMPILER_GCC46 0x02010000
|
|
|
|
#define GLM_COMPILER_GCC50 0x02020000
|
|
|
|
|
|
|
|
// Borland C++ defines. How to identify BC?
|
|
|
|
#define GLM_COMPILER_BC 0x03000000
|
|
|
|
#define GLM_COMPILER_BCB4 0x03000400
|
|
|
|
#define GLM_COMPILER_BCB5 0x03000800
|
|
|
|
#define GLM_COMPILER_BCB6 0x03001000
|
|
|
|
//#define GLM_COMPILER_BCBX 0x03002000 // What's the version value?
|
|
|
|
#define GLM_COMPILER_BCB2009 0x03004000
|
2010-04-29 10:54:07 +00:00
|
|
|
|
|
|
|
#define GLM_MODEL_32 0x00000010
|
|
|
|
#define GLM_MODEL_64 0x00000020
|
|
|
|
|
|
|
|
#ifndef GLM_COMPILER
|
|
|
|
|
2010-04-29 10:56:52 +00:00
|
|
|
// CodeWarrior
|
|
|
|
#define GLM_COMPILER_CODEWARRIOR 0x04000000
|
|
|
|
|
2010-04-29 10:54:07 +00:00
|
|
|
/////////////////
|
|
|
|
// Visual C++ //
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
|
|
|
#if defined(_WIN64)
|
|
|
|
#define GLM_MODEL GLM_MODEL_64
|
|
|
|
#else
|
|
|
|
#define GLM_MODEL GLM_MODEL_32
|
2010-04-29 10:56:52 +00:00
|
|
|
#endif//_WIN64
|
2010-04-29 10:54:07 +00:00
|
|
|
|
|
|
|
#if _MSC_VER == 1400
|
2010-04-29 10:56:52 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_VC2005
|
|
|
|
#elif _MSC_VER == 1500
|
|
|
|
#define GLM_COMPILER GLM_COMPILER_VC2008
|
|
|
|
#elif _MSC_VER == 1600
|
2010-04-29 10:54:07 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_VC2010
|
2010-04-29 10:56:52 +00:00
|
|
|
#else//_MSC_VER
|
|
|
|
#define GLM_COMPILER GLM_COMPILER_VC
|
2010-04-29 10:54:07 +00:00
|
|
|
#endif//_MSC_VER
|
|
|
|
|
|
|
|
//////////////////
|
|
|
|
// GCC defines //
|
|
|
|
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif defined(__GNUC__)
|
2010-04-29 10:54:07 +00:00
|
|
|
|
|
|
|
#if(defined(__WORDSIZE) && (__WORDSIZE == 64)) || defined(__arch64__)
|
|
|
|
#define GLM_MODEL GLM_MODEL_64
|
|
|
|
#else
|
|
|
|
#define GLM_MODEL GLM_MODEL_32
|
|
|
|
#endif//
|
|
|
|
|
2010-04-29 10:56:52 +00:00
|
|
|
#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 2)
|
2010-04-29 10:54:07 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC32
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 3)
|
2010-04-29 10:54:07 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC33
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 4)
|
2010-04-29 10:54:07 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC34
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 5)
|
2010-04-29 10:54:07 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC35
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 0)
|
2010-04-29 10:54:07 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC40
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 1)
|
2010-04-29 10:54:07 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC41
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
|
2010-04-29 10:54:07 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC42
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
|
2010-04-29 10:54:07 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC43
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 4)
|
2010-04-29 10:54:07 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC44
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 5)
|
2010-04-29 10:54:07 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC45
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)
|
2010-04-29 10:54:07 +00:00
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC46
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 0)
|
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC50
|
|
|
|
#else
|
|
|
|
#define GLM_COMPILER GLM_COMPILER_GCC
|
2010-04-29 10:54:07 +00:00
|
|
|
#endif
|
|
|
|
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif defined(_BORLANDC_)
|
|
|
|
|
|
|
|
#if defined(VER125)
|
|
|
|
#define GLM_COMPILER GLM_COMPILER_BCB4
|
|
|
|
#elif defined(VER130)
|
|
|
|
#define GLM_COMPILER GLM_COMPILER_BCB5
|
|
|
|
#elif defined(VER140)
|
|
|
|
#define GLM_COMPILER GLM_COMPILER_BCB6
|
|
|
|
#elif defined(VER200)
|
|
|
|
#define GLM_COMPILER GLM_COMPILER_BCB2009
|
|
|
|
#else
|
|
|
|
#define GLM_COMPILER GLM_COMPILER_BC
|
2010-04-29 10:54:07 +00:00
|
|
|
#endif
|
|
|
|
|
2010-04-29 10:56:52 +00:00
|
|
|
#elif defined(__MWERKS__)
|
|
|
|
|
|
|
|
#define GLM_COMPILER GLM_COMPILER_CODEWARRIOR
|
|
|
|
|
|
|
|
#else
|
|
|
|
#define GLM_COMPILER GLM_COMPILER_UNKNOWNED
|
2010-04-29 10:54:07 +00:00
|
|
|
#endif//__GNUC__
|
|
|
|
|
|
|
|
#endif//GLM_COMPILER
|
|
|
|
|
|
|
|
#ifndef GLM_COMPILER
|
|
|
|
#error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message."
|
|
|
|
#endif//GLM_COMPILER
|
|
|
|
|
|
|
|
#if(!defined(GLM_MODEL) && GLM_COMPILER != 0)
|
|
|
|
#error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message."
|
|
|
|
#endif//GLM_MODEL
|
|
|
|
|
|
|
|
#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))
|
|
|
|
# if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC)
|
|
|
|
# pragma message("GLM message: Compiled with Visual C++")
|
|
|
|
# elif(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_GCC)
|
|
|
|
# pragma message("GLM message: Compiled with GCC")
|
|
|
|
# else
|
|
|
|
# pragma message("GLM warning: Compiler not detected")
|
|
|
|
# endif
|
|
|
|
#endif//GLM_MESSAGE
|
|
|
|
|
|
|
|
#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))
|
|
|
|
# if(GLM_MODEL == GLM_MODEL_64)
|
|
|
|
# pragma message("GLM message: 64 bits model")
|
|
|
|
# elif(GLM_MODEL == GLM_MODEL_32)
|
|
|
|
# pragma message("GLM message: 32 bits model")
|
|
|
|
# endif//GLM_MODEL
|
|
|
|
#endif//GLM_MESSAGE
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Swizzle operators
|
|
|
|
|
|
|
|
#define GLM_SWIZZLE_NONE 0x00000000
|
|
|
|
#define GLM_SWIZZLE_XYZW 0x00000002
|
|
|
|
#define GLM_SWIZZLE_RGBA 0x00000004
|
|
|
|
#define GLM_SWIZZLE_STQP 0x00000008
|
|
|
|
#define GLM_SWIZZLE_FULL (GLM_SWIZZLE_XYZW | GLM_SWIZZLE_RGBA | GLM_SWIZZLE_STQP)
|
|
|
|
|
|
|
|
//! By default:
|
|
|
|
// #define GLM_SWIZZLE GLM_SWIZZLE_NONE
|
|
|
|
|
|
|
|
#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))
|
|
|
|
# if !defined(GLM_SWIZZLE)|| (defined(GLM_SWIZZLE) && GLM_SWIZZLE == GLM_SWIZZLE_NONE)
|
|
|
|
# pragma message("GLM message: No swizzling operator used")
|
|
|
|
# elif(defined(GLM_SWIZZLE) && GLM_SWIZZLE == GLM_SWIZZLE_FULL)
|
|
|
|
# pragma message("GLM message: Full swizzling operator support enabled")
|
|
|
|
# elif(defined(GLM_SWIZZLE) && GLM_SWIZZLE & GLM_SWIZZLE_FULL)
|
|
|
|
# pragma message("GLM message: Partial swizzling operator support enabled")
|
|
|
|
# endif//GLM_SWIZZLE
|
|
|
|
#endif//GLM_MESSAGE
|
|
|
|
|
2010-04-29 10:56:52 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Use options
|
|
|
|
|
|
|
|
// To disable multiple vector component names access.
|
|
|
|
// GLM_USE_ONLY_XYZW
|
|
|
|
|
|
|
|
// To use anonymous union to provide multiple component names access for class valType. Visual C++ only.
|
|
|
|
// GLM_USE_ANONYMOUS_UNION
|
|
|
|
|
|
|
|
#if(defined(GLM_USE_ANONYMOUS_UNION) && !(GLM_COMPILER & GLM_COMPILER_VC))
|
|
|
|
#error "GLM_USE_ANONYMOUS_UNION is defined to use anonymous union implementation of vector types. Anonymous unions can't be used with GCC."
|
|
|
|
#endif//GLM_USE_ANONYMOUS_UNION
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Static assert
|
|
|
|
|
|
|
|
#if(defined(BOOST_STATIC_ASSERT))
|
|
|
|
#define GLM_STATIC_ASSERT(x) BOOST_STATIC_ASSERT(x)
|
|
|
|
#else
|
|
|
|
#define GLM_STATIC_ASSERT(x) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
|
|
|
|
#endif//GLM_DEPENDENCE
|
|
|
|
|
2010-04-29 10:54:07 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#endif//glm_setup
|