Christophe Riccio 15 years ago
parent
commit
c06484ff12

+ 1 - 1
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)

+ 1 - 1
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

+ 0 - 1
glm/gtc/matrix_transform.hpp

@@ -137,7 +137,6 @@ namespace glm
 		//! From GLM_GTC_matrix_transform extension.
 		template <typename T> 
 		detail::tmat4x4<T> lookAt(
-			detail::tmat4x4<T> const & m,
 			detail::tvec3<T> const & eye, 
 			detail::tvec3<T> const & center, 
 			detail::tvec3<T> const & up);

+ 1 - 2
glm/gtc/matrix_transform.inl

@@ -326,7 +326,6 @@ namespace matrix_transform
 
     template <typename T> 
     inline detail::tmat4x4<T> lookAt(
-		detail::tmat4x4<T> const & m,
 		const detail::tvec3<T>& eye, 
 		const detail::tvec3<T>& center, 
 		const detail::tvec3<T>& 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

+ 1 - 1
glm/gtc/swizzle.inl

@@ -21,7 +21,7 @@ inline T swizzle
 	comp x
 )
 {
-	assert(int(x) < int(typename vecType<T>::_size));
+	assert(int(x) < int(vecType<T>::value_size));
 	return v[x];
 }
 

+ 4 - 4
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

+ 0 - 8
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 <typename T>
-		detail::tmat4x4<T> lookAt(
-			detail::tvec3<T> const & eye,
-			detail::tvec3<T> const & center,
-			detail::tvec3<T> const & up);
-
 	}//namespace transform2
     }//namespace gtx
 }//namespace glm

+ 0 - 29
glm/gtx/transform2.inl

@@ -153,35 +153,6 @@ namespace transform2
 		return m * scaleBias(scale, bias);
 	}
 
-	template <typename T>
-	inline detail::tmat4x4<T> lookAt(
-		const detail::tvec3<T>& eye,
-		const detail::tvec3<T>& center,
-		const detail::tvec3<T>& up)
-	{
-		detail::tvec3<T> f = normalize(center - eye);
-		detail::tvec3<T> u = normalize(up);
-		detail::tvec3<T> s = normalize(cross(f, u));
-		u = cross(s, f);
-
-		detail::tmat4x4<T> 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

+ 1 - 3
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 <glm/glm.hpp>
 
 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();

+ 1 - 1
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();

+ 1 - 1
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();

+ 1 - 1
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();

+ 1 - 1
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();

+ 1 - 1
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();

+ 1 - 1
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();

+ 1 - 2
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 <glm/glm.hpp>
 
 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();

+ 1 - 3
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 <glm/glm.hpp>
 
 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();

+ 8 - 10
test/core/core_type_vec4.cpp

@@ -9,8 +9,6 @@
 
 #include <glm/glm.hpp>
 #include <glm/gtc/half_float.hpp>
-#include <xmmintrin.h>
-#include <emmintrin.h>
 
 template <int Value>
 struct mask
@@ -26,12 +24,12 @@ enum comp
 	W
 };
 
-template<comp X, comp Y, comp Z, comp W>
-__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<comp X, comp Y, comp Z, comp W>
+//__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<X, Y, Z, W>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
-	__m128 DataB = swizzle<W, Z, Y, X>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
+	//__m128 DataA = swizzle<X, Y, Z, W>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
+	//__m128 DataB = swizzle<W, Z, Y, X>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
 
 	bool Result = true;
 

+ 1 - 1
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();

+ 1 - 1
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();

+ 1 - 1
test/gtx/gtx-bit.cpp

@@ -127,7 +127,7 @@ namespace bitRevert
 	}
 }//bitRevert
 
-int main(int argc, void* argv[])
+int main()
 {
 	::extractField::test();
 	::bitRevert::test();

+ 1 - 1
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;
 

+ 1 - 2
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 <glm/glm.hpp>
 #include <glm/gtx/simd_vec4.hpp>
 #include <cstdio>
 
-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);