Merge branch '0.9.1' into 0.9.2

This commit is contained in:
Christophe Riccio
2011-04-01 18:02:35 +01:00
33 changed files with 914 additions and 113 deletions

View File

@@ -1206,7 +1206,7 @@ namespace glm
{
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'mix' only accept floating-point inputs");
#if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC)
#if(GLM_COMPILER & GLM_COMPILER_VC)
return typename genType::bool_type(_isnan(x));
#else
return typename genType::bool_type(std::isnan(x));
@@ -1257,7 +1257,7 @@ namespace glm
{
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'isinf' only accept floating-point inputs");
#if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC)
#if(GLM_COMPILER & GLM_COMPILER_VC)
return typename genType::bool_type(_fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF);
#else
return typename genType::bool_type(std::isinf(x));

View File

@@ -274,7 +274,7 @@ namespace glm
Result |= (1 << (sizeof(genIUType) * 8 - 1)) & (1 << (Offset + Bits - 1));
genIUType Mask = 0;
for(std::size_t Bit = Offset; Bit < Bits; ++Bit)
for(int Bit = Offset; Bit < Bits; ++Bit)
Mask |= (1 << Bit);
return Result | ((Mask & Value) >> Offset);
@@ -339,7 +339,7 @@ namespace glm
return Base;
genIUType Mask = 0;
for(std::size_t Bit = Offset; Bit < Offset + Bits; ++Bit)
for(int Bit = Offset; Bit < Offset + Bits; ++Bit)
Mask |= (1 << Bit);
return (Base & ~Mask) | (Insert & Mask);

View File

@@ -1064,7 +1064,7 @@ inline void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m
Result[0] = TmpA4;
Result[1] = TmpB4;
Result[2] = TmpC4;
Result[2] = _mm_set_ps(1, 0, 0, 0);
Result[3] = _mm_set_ps(1, 0, 0, 0);
//detail::tmat4x4<valType> Result(detail::tmat4x4<valType>::null);
//Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2];

View File

@@ -167,13 +167,13 @@
// Report compiler detection
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_COMPILER_DISPLAYED))
# define GLM_MESSAGE_COMPILER_DISPLAYED
# if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC)
# if(GLM_COMPILER & GLM_COMPILER_VC)
# pragma message("GLM: Visual C++ compiler detected")
# elif(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_GCC)
# elif(GLM_COMPILER & GLM_COMPILER_GCC)
# pragma message("GLM: GCC compiler detected")
# elif(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_BC)
# elif(GLM_COMPILER & GLM_COMPILER_BC)
# pragma message("GLM: Borland compiler detected but not supported")
# elif(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_CODEWARRIOR)
# elif(GLM_COMPILER & GLM_COMPILER_CODEWARRIOR)
# pragma message("GLM: Codewarrior compiler detected but not supported")
# else
# pragma message("GLM: Compiler not detected")
@@ -401,21 +401,4 @@
# endif
#endif//GLM_MESSAGE
///////////////////////////////////////////////////////////////////////////////////////////////////
// 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
#endif//glm_setup

View File

@@ -38,7 +38,7 @@ namespace type
//////////////////////////
// Float definition
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)
#if(defined(GLM_PRECISION_HIGHP_FLOAT))
typedef precision::highp_vec2 vec2;
typedef precision::highp_vec3 vec3;
typedef precision::highp_vec4 vec4;
@@ -51,7 +51,7 @@ namespace type
typedef precision::highp_mat4x2 mat4x2;
typedef precision::highp_mat4x3 mat4x3;
typedef precision::highp_mat4x4 mat4x4;
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)
#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
typedef precision::mediump_vec2 vec2;
typedef precision::mediump_vec3 vec3;
typedef precision::mediump_vec4 vec4;
@@ -64,7 +64,7 @@ namespace type
typedef precision::mediump_mat4x2 mat4x2;
typedef precision::mediump_mat4x3 mat4x3;
typedef precision::mediump_mat4x4 mat4x4;
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)
#elif(defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::lowp_vec2 vec2;
typedef precision::lowp_vec3 vec3;
typedef precision::lowp_vec4 vec4;
@@ -158,15 +158,15 @@ namespace type
//////////////////////////
// Signed integer definition
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_INT)
#if(defined(GLM_PRECISION_HIGHP_INT))
typedef precision::highp_ivec2 ivec2;
typedef precision::highp_ivec3 ivec3;
typedef precision::highp_ivec4 ivec4;
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
typedef precision::mediump_ivec2 ivec2;
typedef precision::mediump_ivec3 ivec3;
typedef precision::mediump_ivec4 ivec4;
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_INT)
#elif(defined(GLM_PRECISION_LOWP_INT))
typedef precision::lowp_ivec2 ivec2;
typedef precision::lowp_ivec3 ivec3;
typedef precision::lowp_ivec4 ivec4;
@@ -190,15 +190,15 @@ namespace type
//////////////////////////
// Unsigned integer definition
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)
#if(defined(GLM_PRECISION_HIGHP_UINT))
typedef precision::highp_uvec2 uvec2;
typedef precision::highp_uvec3 uvec3;
typedef precision::highp_uvec4 uvec4;
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)
#elif(defined(GLM_PRECISION_MEDIUMP_UINT))
typedef precision::mediump_uvec2 uvec2;
typedef precision::mediump_uvec3 uvec3;
typedef precision::mediump_uvec4 uvec4;
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_UINT)
#elif(defined(GLM_PRECISION_LOWP_UINT))
typedef precision::lowp_uvec2 uvec2;
typedef precision::lowp_uvec3 uvec3;
typedef precision::lowp_uvec4 uvec4;

View File

@@ -46,7 +46,7 @@ namespace glm
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification
//! \ingroup core_precision
typedef mediump_float_t mediump_float;
typedef mediump_float_t mediump_float;
//! High precision floating-point numbers.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification
@@ -55,18 +55,17 @@ namespace glm
}
//namespace precision
#ifndef GLM_PRECISION
typedef precision::mediump_float float_t;
#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)
typedef precision::highp_float float_t;
#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)
typedef precision::mediump_float float_t;
#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)
typedef precision::lowp_float float_t;
#if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::mediump_float float_t;
#elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::highp_float float_t;
#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::mediump_float float_t;
#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::lowp_float float_t;
#else
# pragma message("GLM message: Precisson undefined for float numbers.");
typedef precision::mediump_float float_t;
#endif//GLM_PRECISION
# error "GLM error: multiple default precision requested for floating-point types"
#endif
}//namespace type
}//namespace core

View File

@@ -54,7 +54,7 @@ namespace glm
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification.
//! \ingroup core_precision
typedef detail::mediump_int_t mediump_int;
typedef detail::mediump_int_t mediump_int;
//! High precision signed integer.
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification.
@@ -75,35 +75,33 @@ namespace glm
//! There is no guarantee on the actual precision.
//! From GLSL 1.30.8 specification.
//! \ingroup core_precision
typedef detail::highp_uint_t highp_uint;
typedef detail::highp_uint_t highp_uint;
}
//namespace precision
#ifndef GLM_PRECISION
#if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef precision::mediump_int int_t;
#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT)
typedef precision::highp_int int_t;
#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)
#elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef precision::highp_int int_t;
#elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef precision::mediump_int int_t;
#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT)
#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
typedef precision::lowp_int int_t;
#else
typedef precision::mediump_int int_t;
# pragma message("GLM message: Precisson undefined for signed integer number.");
#endif//GLM_PRECISION
# error "GLM error: multiple default precision requested for signed interger types"
#endif
#ifndef GLM_PRECISION
#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
typedef precision::mediump_uint uint_t;
#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)
typedef precision::highp_uint uint_t;
#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)
#elif(defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
typedef precision::highp_uint uint_t;
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
typedef precision::mediump_uint uint_t;
#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT)
typedef precision::lowp_uint uint_t;
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))
typedef precision::lowp_uint uint_t;
#else
typedef precision::mediump_uint uint_t;
# pragma message("GLM message: Precisson undefined for unsigned integer number.");
#endif//GLM_PRECISION
# error "GLM error: multiple default precision requested for unsigned interger types"
#endif
//! Unsigned integer.
//! From GLSL 1.30.8 specification section 4.1.3 Integers.