Browse Source

Merge git://github.com/mysticbob/glm into linux

Christophe Riccio 15 years ago
parent
commit
e53a528407
5 changed files with 16 additions and 10 deletions
  1. 8 4
      CMakeLists.txt
  2. 1 1
      glm/core/_detail.hpp
  3. 2 2
      glm/gtc/matrix_transform.inl
  4. 1 1
      glm/gtc/quaternion.inl
  5. 4 2
      test/CMakeLists.txt

+ 8 - 4
CMakeLists.txt

@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
 cmake_policy(VERSION 2.6)
 cmake_policy(VERSION 2.6)
 
 
 project(glm)
 project(glm)
+enable_testing()
 
 
 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
 #add_definitions(-S)
 #add_definitions(-S)
@@ -14,12 +15,15 @@ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
 
 
 include_directories(".")
 include_directories(".")
 
 
+
 add_subdirectory(glm)
 add_subdirectory(glm)
 add_subdirectory(test)
 add_subdirectory(test)
 add_subdirectory(bench)
 add_subdirectory(bench)
 add_subdirectory(doc)
 add_subdirectory(doc)
 
 
-option(GLM_DEVELOPMENT_MODE "GLM development" OFF)
-if(NOT GLM_DEVELOPMENT_MODE)
-	message(FATAL_ERROR "GLM is a header only library, no need to build it")
-endif()
+# option(GLM_DEVELOPMENT_MODE "GLM development" OFF)
+# if(NOT GLM_DEVELOPMENT_MODE)
+#     message(FATAL_ERROR "GLM is a header only library, no need to build it")
+# endif()
+
+install( DIRECTORY glm DESTINATION include )

+ 1 - 1
glm/core/_detail.hpp

@@ -327,7 +327,7 @@ namespace detail
 #	define GLM_RESTRICT_VAR __restrict
 #	define GLM_RESTRICT_VAR __restrict
 #elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC31))
 #elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC31))
 #	define GLM_DEPRECATED __attribute__((__deprecated__))
 #	define GLM_DEPRECATED __attribute__((__deprecated__))
-#	define GLM_ALIGN(x) __attribute__((aligned(x))) 
+#	define GLM_ALIGN(x) __attribute__((aligned(x)))
 #	if(GLM_COMPILER >= GLM_COMPILER_GCC33)
 #	if(GLM_COMPILER >= GLM_COMPILER_GCC33)
 #		define GLM_RESTRICT __restrict__
 #		define GLM_RESTRICT __restrict__
 #		define GLM_RESTRICT_VAR __restrict__
 #		define GLM_RESTRICT_VAR __restrict__

+ 2 - 2
glm/gtc/matrix_transform.inl

@@ -332,14 +332,14 @@ namespace matrix_transform
 		detail::tvec4<U> const & viewport
 		detail::tvec4<U> const & viewport
 	)
 	)
 	{
 	{
-		assert(delta.x > 0.0f && delta.y > 0.0f)
+		assert(delta.x > 0.0f && delta.y > 0.0f);
 		detail::tmat4x4<T> Result(1.0f);
 		detail::tmat4x4<T> Result(1.0f);
 
 
 		if(!(delta.x > 0.0f && delta.y > 0.0f)) 
 		if(!(delta.x > 0.0f && delta.y > 0.0f)) 
 			return Result; // Error
 			return Result; // Error
 
 
 		// Translate and scale the picked region to the entire window
 		// Translate and scale the picked region to the entire window
-		Result = translate(Result, (T(viewport[2]) - T(2) * (x - T(viewport[0]))) / delta.x, (T(viewport[3]) - T(2) * (y - T(viewport[1]))) / delta.y, T(0));
+		Result = translate(Result, (T(viewport[2]) - T(2) * (center.x - T(viewport[0]))) / delta.x, (T(viewport[3]) - T(2) * (center.y - T(viewport[1]))) / delta.y, T(0));
 		return scale(Result, T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1));
 		return scale(Result, T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1));
 	}
 	}
 
 

+ 1 - 1
glm/gtc/quaternion.inl

@@ -403,7 +403,7 @@ namespace quaternion{
 		if(flip)
 		if(flip)
 			alpha = -alpha;
 			alpha = -alpha;
 		
 		
-        return normalize(beta * x + alpha * y2);
+        return normalize(beta * x + alpha * y);
     }
     }
 
 
     template <typename T> 
     template <typename T> 

+ 4 - 2
test/CMakeLists.txt

@@ -1,8 +1,10 @@
 function(glmCreateTestGTC NAME)
 function(glmCreateTestGTC NAME)
 	set(SAMPLE_NAME test-${NAME})
 	set(SAMPLE_NAME test-${NAME})
-
 	add_executable(${SAMPLE_NAME} ${NAME}.cpp ../test.hpp ../test.cpp)
 	add_executable(${SAMPLE_NAME} ${NAME}.cpp ../test.hpp ../test.cpp)
-endfunction(glmCreateTestGTC)
+	add_test( 
+	    NAME ${SAMPLE_NAME}
+	    COMMAND $<TARGET_FILE:${SAMPLE_NAME}> )
+endfunction()
 
 
 add_subdirectory(bug)
 add_subdirectory(bug)
 add_subdirectory(core)
 add_subdirectory(core)