diff --git a/CMakeLists.txt b/CMakeLists.txt index cf873ba9..db4774d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ project(glm) add_definitions(-D_CRT_SECURE_NO_WARNINGS) #add_definitions(-S) #add_definitions(-s) -#add_definitions(-msse2) +add_definitions(-msse2) #add_definitions(-m32) #add_definitions(-mfpmath=387) #add_definitions(-ffast-math) diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index 72885fc0..0e4341bc 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -331,7 +331,7 @@ namespace detail # if(GLM_COMPILER >= GLM_COMPILER_GCC33) # define GLM_RESTRICT __restrict__ # define GLM_RESTRICT_VAR __restrict__ -# elif +# else # define GLM_RESTRICT # define GLM_RESTRICT_VAR # endif diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp index 4461be5a..477dc2eb 100644 --- a/glm/gtc/matrix_transform.hpp +++ b/glm/gtc/matrix_transform.hpp @@ -137,7 +137,6 @@ namespace glm //! From GLM_GTC_matrix_transform extension. template detail::tmat4x4 lookAt( - detail::tmat4x4 const & m, detail::tvec3 const & eye, detail::tvec3 const & center, detail::tvec3 const & up); diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index c43b1e57..858fa68c 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -326,7 +326,6 @@ namespace matrix_transform template inline detail::tmat4x4 lookAt( - detail::tmat4x4 const & m, const detail::tvec3& eye, const detail::tvec3& center, const detail::tvec3& up) @@ -351,7 +350,7 @@ namespace matrix_transform Result[3][1] =-dot(y, eye); Result[3][2] = dot(f, eye); */ - return m * gtc::matrix_transform::translate(Result, -eye); + return gtc::matrix_transform::translate(Result, -eye); } }//namespace matrix_transform }//namespace gtc diff --git a/glm/gtc/swizzle.inl b/glm/gtc/swizzle.inl index ed986e0c..e021e9aa 100644 --- a/glm/gtc/swizzle.inl +++ b/glm/gtc/swizzle.inl @@ -21,7 +21,7 @@ inline T swizzle comp x ) { - assert(int(x) < int(typename vecType::_size)); + assert(int(x) < int(vecType::value_size)); return v[x]; } diff --git a/glm/gtx/simd_vec4.hpp b/glm/gtx/simd_vec4.hpp index 9441b878..f1c363a6 100644 --- a/glm/gtx/simd_vec4.hpp +++ b/glm/gtx/simd_vec4.hpp @@ -17,13 +17,13 @@ // Dependency: #include "../glm.hpp" -#if(!(GLM_ARCH & GLM_ARCH_SSE2)) +#if(GLM_ARCH & GLM_ARCH_SSE2) +# include "../core/intrinsic_common.hpp" +# include "../core/intrinsic_geometric.hpp" +#else # error "GLM: GLM_GTX_simd_vec4 requires compiler support of SSE2 through intrinsics" #endif -#include "../core/intrinsic_common.hpp" -#include "../core/intrinsic_geometric.hpp" - #if(defined(GLM_MESSAGES) && !defined(glm_ext)) # pragma message("GLM: GLM_GTX_simd_vec4 extension included") #endif diff --git a/glm/gtx/transform2.hpp b/glm/gtx/transform2.hpp index 0d204839..f24ff729 100644 --- a/glm/gtx/transform2.hpp +++ b/glm/gtx/transform2.hpp @@ -109,14 +109,6 @@ namespace glm valType scale, valType bias); - //! Build a look at view matrix. - //! From GLM_GTX_transform2 extension. - template - detail::tmat4x4 lookAt( - detail::tvec3 const & eye, - detail::tvec3 const & center, - detail::tvec3 const & up); - }//namespace transform2 }//namespace gtx }//namespace glm diff --git a/glm/gtx/transform2.inl b/glm/gtx/transform2.inl index 49cf9227..1d703111 100644 --- a/glm/gtx/transform2.inl +++ b/glm/gtx/transform2.inl @@ -153,35 +153,6 @@ namespace transform2 return m * scaleBias(scale, bias); } - template - inline detail::tmat4x4 lookAt( - const detail::tvec3& eye, - const detail::tvec3& center, - const detail::tvec3& up) - { - detail::tvec3 f = normalize(center - eye); - detail::tvec3 u = normalize(up); - detail::tvec3 s = normalize(cross(f, u)); - u = cross(s, f); - - detail::tmat4x4 Result(1); - Result[0][0] = s.x; - Result[1][0] = s.y; - Result[2][0] = s.z; - Result[0][1] = u.x; - Result[1][1] = u.y; - Result[2][1] = u.z; - Result[0][2] =-f.x; - Result[1][2] =-f.y; - Result[2][2] =-f.z; - /* Test this instead of translate3D - Result[3][0] =-dot(s, eye); - Result[3][1] =-dot(y, eye); - Result[3][2] = dot(f, eye); - */ - return gtc::matrix_transform::translate(Result, -eye); - } - }//namespace transform2 }//namespace gtx }//namespace glm diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index 7ea129a1..41627eac 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -7,7 +7,6 @@ // File : test/gtx/simd-mat4.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2 #include int test_static_assert() @@ -130,8 +129,7 @@ int test_all() return 0; } - -int main(int argc, void* argv[]) +int main() { int Failed = 0; Failed += test_static_assert(); diff --git a/test/core/core_func_exponential.cpp b/test/core/core_func_exponential.cpp index 7ea129a1..5c3f3cc0 100644 --- a/test/core/core_func_exponential.cpp +++ b/test/core/core_func_exponential.cpp @@ -131,7 +131,7 @@ int test_all() } -int main(int argc, void* argv[]) +int main() { int Failed = 0; Failed += test_static_assert(); diff --git a/test/core/core_func_geometric.cpp b/test/core/core_func_geometric.cpp index 7ea129a1..5c3f3cc0 100644 --- a/test/core/core_func_geometric.cpp +++ b/test/core/core_func_geometric.cpp @@ -131,7 +131,7 @@ int test_all() } -int main(int argc, void* argv[]) +int main() { int Failed = 0; Failed += test_static_assert(); diff --git a/test/core/core_func_integer.cpp b/test/core/core_func_integer.cpp index 7ea129a1..5c3f3cc0 100644 --- a/test/core/core_func_integer.cpp +++ b/test/core/core_func_integer.cpp @@ -131,7 +131,7 @@ int test_all() } -int main(int argc, void* argv[]) +int main() { int Failed = 0; Failed += test_static_assert(); diff --git a/test/core/core_func_matrix.cpp b/test/core/core_func_matrix.cpp index 7ea129a1..5c3f3cc0 100644 --- a/test/core/core_func_matrix.cpp +++ b/test/core/core_func_matrix.cpp @@ -131,7 +131,7 @@ int test_all() } -int main(int argc, void* argv[]) +int main() { int Failed = 0; Failed += test_static_assert(); diff --git a/test/core/core_func_noise.cpp b/test/core/core_func_noise.cpp index 7ea129a1..5c3f3cc0 100644 --- a/test/core/core_func_noise.cpp +++ b/test/core/core_func_noise.cpp @@ -131,7 +131,7 @@ int test_all() } -int main(int argc, void* argv[]) +int main() { int Failed = 0; Failed += test_static_assert(); diff --git a/test/core/core_func_packing.cpp b/test/core/core_func_packing.cpp index 7ea129a1..5c3f3cc0 100644 --- a/test/core/core_func_packing.cpp +++ b/test/core/core_func_packing.cpp @@ -131,7 +131,7 @@ int test_all() } -int main(int argc, void* argv[]) +int main() { int Failed = 0; Failed += test_static_assert(); diff --git a/test/core/core_func_trigonometric.cpp b/test/core/core_func_trigonometric.cpp index 7ea129a1..835b18e3 100644 --- a/test/core/core_func_trigonometric.cpp +++ b/test/core/core_func_trigonometric.cpp @@ -7,7 +7,6 @@ // File : test/gtx/simd-mat4.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2 #include int test_static_assert() @@ -131,7 +130,7 @@ int test_all() } -int main(int argc, void* argv[]) +int main() { int Failed = 0; Failed += test_static_assert(); diff --git a/test/core/core_func_vector_relational.cpp b/test/core/core_func_vector_relational.cpp index 7ea129a1..41627eac 100644 --- a/test/core/core_func_vector_relational.cpp +++ b/test/core/core_func_vector_relational.cpp @@ -7,7 +7,6 @@ // File : test/gtx/simd-mat4.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2 #include int test_static_assert() @@ -130,8 +129,7 @@ int test_all() return 0; } - -int main(int argc, void* argv[]) +int main() { int Failed = 0; Failed += test_static_assert(); diff --git a/test/core/core_type_vec4.cpp b/test/core/core_type_vec4.cpp index a307130f..2edb4645 100644 --- a/test/core/core_type_vec4.cpp +++ b/test/core/core_type_vec4.cpp @@ -9,8 +9,6 @@ #include #include -#include -#include template struct mask @@ -26,12 +24,12 @@ enum comp W }; -template -__m128 swizzle(glm::vec4 const & v) -{ - __m128 Src = _mm_set_ps(v.w, v.z, v.y, v.x); - return _mm_shuffle_ps(Src, Src, mask<(int(W) << 6) | (int(Z) << 4) | (int(Y) << 2) | (int(X) << 0)>::value); -} +//template +//__m128 swizzle(glm::vec4 const & v) +//{ +// __m128 Src = _mm_set_ps(v.w, v.z, v.y, v.x); +// return _mm_shuffle_ps(Src, Src, mask<(int(W) << 6) | (int(Z) << 4) | (int(Y) << 2) | (int(X) << 0)>::value); +//} bool test_hvec4() { @@ -57,8 +55,8 @@ int main() { test_hvec4(); - __m128 DataA = swizzle(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f)); - __m128 DataB = swizzle(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f)); + //__m128 DataA = swizzle(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f)); + //__m128 DataB = swizzle(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f)); bool Result = true; diff --git a/test/gtc/gtc-integer-matrix.cpp b/test/gtc/gtc-integer-matrix.cpp index 79074875..b6b06c11 100644 --- a/test/gtc/gtc-integer-matrix.cpp +++ b/test/gtc/gtc-integer-matrix.cpp @@ -20,7 +20,7 @@ int test_int_matrix() return 0; } -int main(int argc, void* argv[]) +int main() { int Failed = 0; Failed += test_int_matrix(); diff --git a/test/gtc/gtc-swizzle.cpp b/test/gtc/gtc-swizzle.cpp index d482260a..917976d6 100644 --- a/test/gtc/gtc-swizzle.cpp +++ b/test/gtc/gtc-swizzle.cpp @@ -114,7 +114,7 @@ int test_swizzle_vec4_const_static() return 0; } -int main(int argc, void* argv[]) +int main() { int Failed = 0; Failed += test_swizzle_vec4_ref_dynamic(); diff --git a/test/gtx/gtx-bit.cpp b/test/gtx/gtx-bit.cpp index 8f210199..99bb586f 100644 --- a/test/gtx/gtx-bit.cpp +++ b/test/gtx/gtx-bit.cpp @@ -127,7 +127,7 @@ namespace bitRevert } }//bitRevert -int main(int argc, void* argv[]) +int main() { ::extractField::test(); ::bitRevert::test(); diff --git a/test/gtx/gtx-simd-mat4.cpp b/test/gtx/gtx-simd-mat4.cpp index 66a24d4b..f82e727b 100644 --- a/test/gtx/gtx-simd-mat4.cpp +++ b/test/gtx/gtx-simd-mat4.cpp @@ -221,7 +221,7 @@ int test_compute_gtx() return Output.size() != 0; } -int main(int argc, void* argv[]) +int main() { int Failed = GLM_COMPILER; diff --git a/test/gtx/gtx-simd-vec4.cpp b/test/gtx/gtx-simd-vec4.cpp index 24f7fe31..f13ba95f 100644 --- a/test/gtx/gtx-simd-vec4.cpp +++ b/test/gtx/gtx-simd-vec4.cpp @@ -7,12 +7,11 @@ // File : test/gtx/simd-vec4.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2 #include #include #include -int main(int argc, char* argv[]) +int main() { glm::simd_vec4 A1(0.0f, 0.1f, 0.2f, 0.3f); glm::simd_vec4 B1(0.4f, 0.5f, 0.6f, 0.7f);