diff --git a/CMakeLists.txt b/CMakeLists.txt index 35ea2cc5..93d9325b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,9 @@ if(CMAKE_COMPILER_IS_GNUCXX) #add_definitions(-S) #add_definitions(-s) add_definitions(-msse2) - add_definitions(-std=c++0x ) + add_definitions(-std=c++0x) + add_definitions(-fms-extensions) + add_definitions(-D_MSC_EXTENSIONS) #add_definitions(-m32) #add_definitions(-mfpmath=387) #add_definitions(-ffast-math) diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index 0f29b538..f7714891 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -62,9 +62,9 @@ namespace detail ////////////////////////////////////// // Data -# if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) +# if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) value_type x, y; -# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) +# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT || GLM_LANG == GLM_LANG_CXX0X) union { _GLM_SWIZZLE2_2_MEMBERS(value_type,glm::detail::tvec2,x,y) @@ -81,10 +81,10 @@ namespace detail struct{value_type s, t;}; struct{value_type x, y;}; }; -# else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) +# else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) union {value_type x, r, s;}; union {value_type y, g, t;}; -# endif//GLM_COMPONENT +# endif//GLM_COMPONENT ////////////////////////////////////// // Accesses diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 8c343aa0..bb50e7e1 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -64,18 +64,18 @@ namespace detail # if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) value_type x, y, z, w; -# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) +# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT || GLM_LANG == GLM_LANG_CXX0X) union { - _GLM_SWIZZLE4_2_MEMBERS(value_type,glm::detail::tvec2,x,y,z,w) - _GLM_SWIZZLE4_2_MEMBERS(value_type,glm::detail::tvec2,r,g,b,a) - _GLM_SWIZZLE4_2_MEMBERS(value_type,glm::detail::tvec2,s,t,p,q) - _GLM_SWIZZLE4_3_MEMBERS(value_type,glm::detail::tvec3,x,y,z,w) - _GLM_SWIZZLE4_3_MEMBERS(value_type,glm::detail::tvec3,r,g,b,a) - _GLM_SWIZZLE4_3_MEMBERS(value_type,glm::detail::tvec3,s,t,p,q) - _GLM_SWIZZLE4_4_MEMBERS(value_type,glm::detail::tvec4,x,y,z,w) - _GLM_SWIZZLE4_4_MEMBERS(value_type,glm::detail::tvec4,r,g,b,a) - _GLM_SWIZZLE4_4_MEMBERS(value_type,glm::detail::tvec4,s,t,p,q) + _GLM_SWIZZLE4_2_MEMBERS(value_type,glm::detail::tvec2,x,y,z,w) + _GLM_SWIZZLE4_2_MEMBERS(value_type,glm::detail::tvec2,r,g,b,a) + _GLM_SWIZZLE4_2_MEMBERS(value_type,glm::detail::tvec2,s,t,p,q) + _GLM_SWIZZLE4_3_MEMBERS(value_type,glm::detail::tvec3,x,y,z,w) + _GLM_SWIZZLE4_3_MEMBERS(value_type,glm::detail::tvec3,r,g,b,a) + _GLM_SWIZZLE4_3_MEMBERS(value_type,glm::detail::tvec3,s,t,p,q) + _GLM_SWIZZLE4_4_MEMBERS(value_type,glm::detail::tvec4,x,y,z,w) + _GLM_SWIZZLE4_4_MEMBERS(value_type,glm::detail::tvec4,r,g,b,a) + _GLM_SWIZZLE4_4_MEMBERS(value_type,glm::detail::tvec4,s,t,p,q) struct{value_type r, g, b, a;}; struct{value_type s, t, p, q;}; diff --git a/glm/gtc/half_float.hpp b/glm/gtc/half_float.hpp index 8cb6689d..8c8896de 100644 --- a/glm/gtc/half_float.hpp +++ b/glm/gtc/half_float.hpp @@ -47,7 +47,7 @@ namespace glm{ namespace detail { -#ifndef _MSC_EXTENSIONS +#if 0 //ndef _MSC_EXTENSIONS template <> struct tvec2 { diff --git a/glm/gtc/half_float.inl b/glm/gtc/half_float.inl index 9110610b..7e1d16fa 100644 --- a/glm/gtc/half_float.inl +++ b/glm/gtc/half_float.inl @@ -514,494 +514,6 @@ namespace detail ( tvec3 const & v ) - { - this->x -= v.x; - this->y -= v.y; - this->z -= v.z; - return *this; - } - - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator*= - ( - thalf const & s - ) - { - this->x *= s; - this->y *= s; - this->z *= s; - return *this; - } - - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator*= - ( - tvec3 const & v - ) - { - this->x *= v.x; - this->y *= v.y; - this->z *= v.z; - return *this; - } - - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator/= - ( - thalf const & s - ) - { - this->x /= s; - this->y /= s; - this->z /= s; - return *this; - } - - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator/= - ( - tvec3 const & v - ) - { - this->x /= v.x; - this->y /= v.y; - this->z /= v.z; - return *this; - } - - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator++() - { - ++this->x; - ++this->y; - ++this->z; - return *this; - } - - GLM_FUNC_QUALIFIER tvec3 & tvec3::operator--() - { - --this->x; - --this->y; - --this->z; - return *this; - } - - ////////////////////////////////////// - // Swizzle operators - - GLM_FUNC_QUALIFIER thalf tvec3::swizzle(comp x) const - { - return (*this)[x]; - } - - GLM_FUNC_QUALIFIER tvec2 tvec3::swizzle(comp x, comp y) const - { - return tvec2( - (*this)[x], - (*this)[y]); - } - - GLM_FUNC_QUALIFIER tvec3 tvec3::swizzle(comp x, comp y, comp z) const - { - return tvec3( - (*this)[x], - (*this)[y], - (*this)[z]); - } - - GLM_FUNC_QUALIFIER tvec4 tvec3::swizzle(comp x, comp y, comp z, comp w) const - { - return tvec4( - (*this)[x], - (*this)[y], - (*this)[z], - (*this)[w]); - } - - GLM_FUNC_QUALIFIER tref3 tvec3::swizzle(comp x, comp y, comp z) - { - return tref3( - (*this)[x], - (*this)[y], - (*this)[z]); - } - - ////////////////////////////////////// - // hvec4 - - GLM_FUNC_QUALIFIER tvec4::size_type tvec4::length() const - { - return 4; - } - - GLM_FUNC_QUALIFIER tvec4::size_type tvec4::value_size() - { - return 4; - } - - ////////////////////////////////////// - // Accesses - - GLM_FUNC_QUALIFIER thalf & tvec4::operator[] - ( - tvec4::size_type i - ) - { - assert(/*i >= tvec4::size_type(0) && */i < tvec4::value_size()); - - return (&x)[i]; - } - - GLM_FUNC_QUALIFIER thalf const & tvec4::operator[] - ( - tvec4::size_type i - ) const - { - assert(/*i >= tvec4::size_type(0) && */i < tvec4::value_size()); - - return (&x)[i]; - } - - ////////////////////////////////////// - // Implicit basic constructors - - GLM_FUNC_QUALIFIER tvec4::tvec4() : - x(thalf(0)), - y(thalf(0)), - z(thalf(0)), - w(thalf(0)) - {} - - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - tvec4 const & v - ) : - x(v.x), - y(v.y), - z(v.z), - w(v.w) - {} - - ////////////////////////////////////// - // Explicit basic constructors - - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - thalf const & s - ) : - x(s), - y(s), - z(s), - w(s) - {} - - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - thalf const & s1, - thalf const & s2, - thalf const & s3, - thalf const & s4 - ) : - x(s1), - y(s2), - z(s3), - w(s4) - {} - - ////////////////////////////////////// - // Swizzle constructors - - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - tref4 const & r - ) : - x(r.x), - y(r.y), - z(r.z), - w(r.w) - {} - - ////////////////////////////////////// - // Convertion scalar constructors - - template - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - U const & x - ) : - x(thalf(x)), - y(thalf(x)), - z(thalf(x)), - w(thalf(x)) - {} - - template - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - A const & x, - B const & y, - C const & z, - D const & w - ) : - x(thalf(x)), - y(thalf(y)), - z(thalf(z)), - w(thalf(w)) - {} - - ////////////////////////////////////// - // Convertion vector constructors - - template - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - tvec2 const & v, - B const & s1, - C const & s2 - ) : - x(thalf(v.x)), - y(thalf(v.y)), - z(thalf(s1)), - w(thalf(s2)) - {} - - template - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - A const & s1, - tvec2 const & v, - C const & s2 - ) : - x(thalf(s1)), - y(thalf(v.x)), - z(thalf(v.y)), - w(thalf(s2)) - {} - - template - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - A const & s1, - B const & s2, - tvec2 const & v - ) : - x(thalf(s1)), - y(thalf(s2)), - z(thalf(v.x)), - w(thalf(v.y)) - {} - - template - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - tvec3 const & v, - B const & s - ) : - x(thalf(v.x)), - y(thalf(v.y)), - z(thalf(v.z)), - w(thalf(s)) - {} - - template - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - A const & s, - tvec3 const & v - ) : - x(thalf(s)), - y(thalf(v.x)), - z(thalf(v.y)), - w(thalf(v.z)) - {} - - template - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - tvec2 const & v1, - tvec2 const & v2 - ) : - x(thalf(v1.x)), - y(thalf(v1.y)), - z(thalf(v2.x)), - w(thalf(v2.y)) - {} - - template - GLM_FUNC_QUALIFIER tvec4::tvec4 - ( - tvec4 const & v - ) : - x(thalf(v.x)), - y(thalf(v.y)), - z(thalf(v.z)), - w(thalf(v.w)) - {} - - ////////////////////////////////////// - // Unary arithmetic operators - - GLM_FUNC_QUALIFIER tvec4& tvec4::operator= - ( - tvec4 const & v - ) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - this->w = v.w; - return *this; - } - - GLM_FUNC_QUALIFIER tvec4& tvec4::operator+= - ( - thalf const & s - ) - { - this->x += s; - this->y += s; - this->z += s; - this->w += s; - return *this; - } - - GLM_FUNC_QUALIFIER tvec4& tvec4::operator+= - ( - tvec4 const & v - ) - { - this->x += v.x; - this->y += v.y; - this->z += v.z; - this->w += v.w; - return *this; - } - - GLM_FUNC_QUALIFIER tvec4& tvec4::operator-= - ( - thalf const & s - ) - { - this->x -= s; - this->y -= s; - this->z -= s; - this->w -= s; - return *this; - } - - GLM_FUNC_QUALIFIER tvec4& tvec4::operator-= - ( - tvec4 const & v - ) - { - this->x -= v.x; - this->y -= v.y; - this->z -= v.z; - this->w -= v.w; - return *this; - } - - GLM_FUNC_QUALIFIER tvec4& tvec4::operator*= - ( - thalf const & s - ) - { - this->x *= s; - this->y *= s; - this->z *= s; - this->w *= s; - return *this; - } - - GLM_FUNC_QUALIFIER tvec4& tvec4::operator*= - ( - tvec4 const & v - ) - { - this->x *= v.x; - this->y *= v.y; - this->z *= v.z; - this->w *= v.w; - return *this; - } - - GLM_FUNC_QUALIFIER tvec4& tvec4::operator/= - ( - thalf const & s - ) - { - this->x /= s; - this->y /= s; - this->z /= s; - this->w /= s; - return *this; - } - - GLM_FUNC_QUALIFIER tvec4& tvec4::operator/= - ( - tvec4 const & v - ) - { - this->x /= v.x; - this->y /= v.y; - this->z /= v.z; - this->w /= v.w; - return *this; - } - - GLM_FUNC_QUALIFIER tvec4& tvec4::operator++() - { - ++this->x; - ++this->y; - ++this->z; - ++this->w; - return *this; - } - - GLM_FUNC_QUALIFIER tvec4& tvec4::operator--() - { - --this->x; - --this->y; - --this->z; - --this->w; - return *this; - } - - ////////////////////////////////////// - // Swizzle operators - - GLM_FUNC_QUALIFIER thalf tvec4::swizzle(comp x) const - { - return (*this)[x]; - } - - GLM_FUNC_QUALIFIER tvec2 tvec4::swizzle(comp x, comp y) const - { - return tvec2( - (*this)[x], - (*this)[y]); - } - - GLM_FUNC_QUALIFIER tvec3 tvec4::swizzle(comp x, comp y, comp z) const - { - return tvec3( - (*this)[x], - (*this)[y], - (*this)[z]); - } - - GLM_FUNC_QUALIFIER tvec4 tvec4::swizzle(comp x, comp y, comp z, comp w) const - { - return tvec4( - (*this)[x], - (*this)[y], - (*this)[z], - (*this)[w]); - } - - GLM_FUNC_QUALIFIER tref4 tvec4::swizzle(comp x, comp y, comp z, comp w) - { - return tref4( - (*this)[x], - (*this)[y], - (*this)[z], - (*this)[w]); - } #endif//_MSC_EXTENSIONS diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index b872b40a..eb1c13eb 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -9,6 +9,7 @@ #include #include +#include #include int test_vec3_ctor() @@ -421,5 +422,7 @@ int main() Error += test_vec3_swizzle_operators(); Error += test_vec3_swizzle_functions(); + printf("Errors: %d\n", Error); + return Error; }