From 630f529da821cdca4ec72f992fcb34facf645d91 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 14 Feb 2011 15:17:22 +0000 Subject: [PATCH 01/13] Fixed theme --- doc/theme/doxygen.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/theme/doxygen.css b/doc/theme/doxygen.css index f146cb93..8c3f35eb 100644 --- a/doc/theme/doxygen.css +++ b/doc/theme/doxygen.css @@ -126,6 +126,8 @@ a { margin-left:auto; margin-right:auto; padding:0px; + padding-top:8px; + padding-bottom:8px; width:1000px; } From cc485cb4c11e3505c286760fdf6d8fc7a8b9aa85 Mon Sep 17 00:00:00 2001 From: Bob Kuehne Date: Tue, 15 Feb 2011 12:25:21 -0500 Subject: [PATCH 02/13] added proper cmake test infrastructure --- CMakeLists.txt | 12 ++++++++---- test/CMakeLists.txt | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07e3e428..8e1262f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6 FATAL_ERROR) cmake_policy(VERSION 2.6) project(glm) +enable_testing() add_definitions(-D_CRT_SECURE_NO_WARNINGS) #add_definitions(-S) @@ -14,12 +15,15 @@ add_definitions(-D_CRT_SECURE_NO_WARNINGS) include_directories(".") + add_subdirectory(glm) add_subdirectory(test) add_subdirectory(bench) 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 ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c41aeb62..8b809b54 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,8 +1,10 @@ function(glmCreateTestGTC NAME) set(SAMPLE_NAME test-${NAME}) - add_executable(${SAMPLE_NAME} ${NAME}.cpp ../test.hpp ../test.cpp) -endfunction(glmCreateTestGTC) + add_test( + NAME ${SAMPLE_NAME} + COMMAND $ ) +endfunction() add_subdirectory(bug) add_subdirectory(core) From ba910c7be252909b7acad7f46cb7fa13ad88dc39 Mon Sep 17 00:00:00 2001 From: Bob Kuehne Date: Tue, 15 Feb 2011 12:34:39 -0500 Subject: [PATCH 03/13] fixes for linux --- glm/core/_detail.hpp | 2 +- glm/gtc/matrix_transform.inl | 4 ++-- glm/gtc/quaternion.inl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index 7cdc2ed0..16124b41 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -327,7 +327,7 @@ namespace detail # define GLM_RESTRICT_VAR __restrict #elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) # 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) # define GLM_RESTRICT __restrict__ # define GLM_RESTRICT_VAR __restrict__ diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index b8e79ca2..b063c363 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -332,14 +332,14 @@ namespace matrix_transform detail::tvec4 const & viewport ) { - assert(delta.x > 0.0f && delta.y > 0.0f) + assert(delta.x > 0.0f && delta.y > 0.0f); detail::tmat4x4 Result(1.0f); if(!(delta.x > 0.0f && delta.y > 0.0f)) return Result; // Error // 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)); } diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index 32577b77..2dbca071 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -403,7 +403,7 @@ namespace quaternion{ if(flip) alpha = -alpha; - return normalize(beta * x + alpha * y2); + return normalize(beta * x + alpha * y); } template From 8ae490c437c2853a8242d7c5e4f5817064b1c73f Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 17 Feb 2011 11:27:36 +0000 Subject: [PATCH 04/13] Fixed cast --- glm/gtc/matrix_transform.inl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index b063c363..1263ce53 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -332,10 +332,10 @@ namespace matrix_transform detail::tvec4 const & viewport ) { - assert(delta.x > 0.0f && delta.y > 0.0f); + assert(delta.x > T(0) && delta.y > T(0)); detail::tmat4x4 Result(1.0f); - if(!(delta.x > 0.0f && delta.y > 0.0f)) + if(!(delta.x > T(0) && delta.y > T(0))) return Result; // Error // Translate and scale the picked region to the entire window From 236ef49a6730dc12084b600fd4a295f3559c8089 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 17 Feb 2011 11:45:17 +0000 Subject: [PATCH 05/13] Updated the FATAL_ERROR option --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e1262f0..d0889557 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,9 +21,9 @@ add_subdirectory(test) add_subdirectory(bench) 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_TEST_MODE "GLM test" OFF) +if(NOT GLM_TEST_MODE) + message(FATAL_ERROR "GLM is a header only library, no need to build it. Set the option GLM_TEST_MODE to ON if you want to run the test bench") +endif() install( DIRECTORY glm DESTINATION include ) From a3d359a2783502d51491ea4cc584305226017e8c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 17 Feb 2011 11:59:43 +0000 Subject: [PATCH 06/13] Updated GLM_TEST_MODE message --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0889557..f481ce80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ add_subdirectory(doc) option(GLM_TEST_MODE "GLM test" OFF) if(NOT GLM_TEST_MODE) - message(FATAL_ERROR "GLM is a header only library, no need to build it. Set the option GLM_TEST_MODE to ON if you want to run the test bench") + message(FATAL_ERROR "GLM is a header only library, no need to build it. Set the option GLM_TEST_MODE with ON to build and run the test bench") endif() install( DIRECTORY glm DESTINATION include ) From 680485f8f74c36e8301e30d873f187d4114832b9 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 21 Feb 2011 13:23:04 +0000 Subject: [PATCH 07/13] Removed CMake test from GLM 0.9.1 branch --- test/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8b809b54..e0575dd3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,9 +1,10 @@ function(glmCreateTestGTC NAME) set(SAMPLE_NAME test-${NAME}) add_executable(${SAMPLE_NAME} ${NAME}.cpp ../test.hpp ../test.cpp) - add_test( - NAME ${SAMPLE_NAME} - COMMAND $ ) + #For GLM 0.9.2, not ready yet + #add_test( + # NAME ${SAMPLE_NAME} + # COMMAND $ ) endfunction() add_subdirectory(bug) From e09a1f497e5dc762a51dbd2aee1765a0c575fb3d Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 21 Feb 2011 14:16:06 +0000 Subject: [PATCH 08/13] Resoved ticket #50, removed some warnings --- CMakeLists.txt | 3 +- glm/core/_detail.hpp | 2 +- glm/gtc/swizzle.hpp | 330 +++++++++++++++++++++---------------------- 3 files changed, 168 insertions(+), 167 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f481ce80..a502bd38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,9 +5,10 @@ project(glm) enable_testing() add_definitions(-D_CRT_SECURE_NO_WARNINGS) +add_definitions(-pedantic) #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 16124b41..d11d7052 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -259,7 +259,7 @@ namespace detail _YES = 1, \ _NO = 0 \ }; \ - }; + } ////////////////// // matrix diff --git a/glm/gtc/swizzle.hpp b/glm/gtc/swizzle.hpp index 5134a460..7ebd630c 100644 --- a/glm/gtc/swizzle.hpp +++ b/glm/gtc/swizzle.hpp @@ -148,113 +148,113 @@ namespace glm inline detail::tvec4 swizzle(detail::tvec##SIZE const & v) \ {return detail::tvec4(v[x], v[y], v[z], v[w]);} */ - static_swizzle2_const(glm::f16vec2); - static_swizzle2_const(glm::f16vec3); - static_swizzle2_const(glm::f16vec4); - static_swizzle2_const(glm::f32vec2); - static_swizzle2_const(glm::f32vec3); - static_swizzle2_const(glm::f32vec4); - static_swizzle2_const(glm::f64vec2); - static_swizzle2_const(glm::f64vec3); - static_swizzle2_const(glm::f64vec4); + static_swizzle2_const(glm::f16vec2) + static_swizzle2_const(glm::f16vec3) + static_swizzle2_const(glm::f16vec4) + static_swizzle2_const(glm::f32vec2) + static_swizzle2_const(glm::f32vec3) + static_swizzle2_const(glm::f32vec4) + static_swizzle2_const(glm::f64vec2) + static_swizzle2_const(glm::f64vec3) + static_swizzle2_const(glm::f64vec4) - static_swizzle2_const(glm::i8vec2); - static_swizzle2_const(glm::i8vec3); - static_swizzle2_const(glm::i8vec4); - static_swizzle2_const(glm::i16vec2); - static_swizzle2_const(glm::i16vec3); - static_swizzle2_const(glm::i16vec4); - static_swizzle2_const(glm::i32vec2); - static_swizzle2_const(glm::i32vec3); - static_swizzle2_const(glm::i32vec4); - static_swizzle2_const(glm::i64vec2); - static_swizzle2_const(glm::i64vec3); - static_swizzle2_const(glm::i64vec4); + static_swizzle2_const(glm::i8vec2) + static_swizzle2_const(glm::i8vec3) + static_swizzle2_const(glm::i8vec4) + static_swizzle2_const(glm::i16vec2) + static_swizzle2_const(glm::i16vec3) + static_swizzle2_const(glm::i16vec4) + static_swizzle2_const(glm::i32vec2) + static_swizzle2_const(glm::i32vec3) + static_swizzle2_const(glm::i32vec4) + static_swizzle2_const(glm::i64vec2) + static_swizzle2_const(glm::i64vec3) + static_swizzle2_const(glm::i64vec4) - static_swizzle2_const(glm::u8vec2); - static_swizzle2_const(glm::u8vec3); - static_swizzle2_const(glm::u8vec4); - static_swizzle2_const(glm::u16vec2); - static_swizzle2_const(glm::u16vec3); - static_swizzle2_const(glm::u16vec4); - static_swizzle2_const(glm::u32vec2); - static_swizzle2_const(glm::u32vec3); - static_swizzle2_const(glm::u32vec4); - static_swizzle2_const(glm::u64vec2); - static_swizzle2_const(glm::u64vec3); - static_swizzle2_const(glm::u64vec4); + static_swizzle2_const(glm::u8vec2) + static_swizzle2_const(glm::u8vec3) + static_swizzle2_const(glm::u8vec4) + static_swizzle2_const(glm::u16vec2) + static_swizzle2_const(glm::u16vec3) + static_swizzle2_const(glm::u16vec4) + static_swizzle2_const(glm::u32vec2) + static_swizzle2_const(glm::u32vec3) + static_swizzle2_const(glm::u32vec4) + static_swizzle2_const(glm::u64vec2) + static_swizzle2_const(glm::u64vec3) + static_swizzle2_const(glm::u64vec4) - static_swizzle3_const(glm::f16vec2); - static_swizzle3_const(glm::f16vec3); - static_swizzle3_const(glm::f16vec4); - static_swizzle3_const(glm::f32vec2); - static_swizzle3_const(glm::f32vec3); - static_swizzle3_const(glm::f32vec4); - static_swizzle3_const(glm::f64vec2); - static_swizzle3_const(glm::f64vec3); - static_swizzle3_const(glm::f64vec4); + static_swizzle3_const(glm::f16vec2) + static_swizzle3_const(glm::f16vec3) + static_swizzle3_const(glm::f16vec4) + static_swizzle3_const(glm::f32vec2) + static_swizzle3_const(glm::f32vec3) + static_swizzle3_const(glm::f32vec4) + static_swizzle3_const(glm::f64vec2) + static_swizzle3_const(glm::f64vec3) + static_swizzle3_const(glm::f64vec4) - static_swizzle3_const(glm::i8vec2); - static_swizzle3_const(glm::i8vec3); - static_swizzle3_const(glm::i8vec4); - static_swizzle3_const(glm::i16vec2); - static_swizzle3_const(glm::i16vec3); - static_swizzle3_const(glm::i16vec4); - static_swizzle3_const(glm::i32vec2); - static_swizzle3_const(glm::i32vec3); - static_swizzle3_const(glm::i32vec4); - static_swizzle3_const(glm::i64vec2); - static_swizzle3_const(glm::i64vec3); - static_swizzle3_const(glm::i64vec4); + static_swizzle3_const(glm::i8vec2) + static_swizzle3_const(glm::i8vec3) + static_swizzle3_const(glm::i8vec4) + static_swizzle3_const(glm::i16vec2) + static_swizzle3_const(glm::i16vec3) + static_swizzle3_const(glm::i16vec4) + static_swizzle3_const(glm::i32vec2) + static_swizzle3_const(glm::i32vec3) + static_swizzle3_const(glm::i32vec4) + static_swizzle3_const(glm::i64vec2) + static_swizzle3_const(glm::i64vec3) + static_swizzle3_const(glm::i64vec4) - static_swizzle3_const(glm::u8vec2); - static_swizzle3_const(glm::u8vec3); - static_swizzle3_const(glm::u8vec4); - static_swizzle3_const(glm::u16vec2); - static_swizzle3_const(glm::u16vec3); - static_swizzle3_const(glm::u16vec4); - static_swizzle3_const(glm::u32vec2); - static_swizzle3_const(glm::u32vec3); - static_swizzle3_const(glm::u32vec4); - static_swizzle3_const(glm::u64vec2); - static_swizzle3_const(glm::u64vec3); - static_swizzle3_const(glm::u64vec4); + static_swizzle3_const(glm::u8vec2) + static_swizzle3_const(glm::u8vec3) + static_swizzle3_const(glm::u8vec4) + static_swizzle3_const(glm::u16vec2) + static_swizzle3_const(glm::u16vec3) + static_swizzle3_const(glm::u16vec4) + static_swizzle3_const(glm::u32vec2) + static_swizzle3_const(glm::u32vec3) + static_swizzle3_const(glm::u32vec4) + static_swizzle3_const(glm::u64vec2) + static_swizzle3_const(glm::u64vec3) + static_swizzle3_const(glm::u64vec4) - static_swizzle4_const(glm::f16vec2); - static_swizzle4_const(glm::f16vec3); - static_swizzle4_const(glm::f16vec4); - static_swizzle4_const(glm::f32vec2); - static_swizzle4_const(glm::f32vec3); - static_swizzle4_const(glm::f32vec4); - static_swizzle4_const(glm::f64vec2); - static_swizzle4_const(glm::f64vec3); - static_swizzle4_const(glm::f64vec4); + static_swizzle4_const(glm::f16vec2) + static_swizzle4_const(glm::f16vec3) + static_swizzle4_const(glm::f16vec4) + static_swizzle4_const(glm::f32vec2) + static_swizzle4_const(glm::f32vec3) + static_swizzle4_const(glm::f32vec4) + static_swizzle4_const(glm::f64vec2) + static_swizzle4_const(glm::f64vec3) + static_swizzle4_const(glm::f64vec4) - static_swizzle4_const(glm::i8vec2); - static_swizzle4_const(glm::i8vec3); - static_swizzle4_const(glm::i8vec4); - static_swizzle4_const(glm::i16vec2); - static_swizzle4_const(glm::i16vec3); - static_swizzle4_const(glm::i16vec4); - static_swizzle4_const(glm::i32vec2); - static_swizzle4_const(glm::i32vec3); - static_swizzle4_const(glm::i32vec4); - static_swizzle4_const(glm::i64vec2); - static_swizzle4_const(glm::i64vec3); - static_swizzle4_const(glm::i64vec4); + static_swizzle4_const(glm::i8vec2) + static_swizzle4_const(glm::i8vec3) + static_swizzle4_const(glm::i8vec4) + static_swizzle4_const(glm::i16vec2) + static_swizzle4_const(glm::i16vec3) + static_swizzle4_const(glm::i16vec4) + static_swizzle4_const(glm::i32vec2) + static_swizzle4_const(glm::i32vec3) + static_swizzle4_const(glm::i32vec4) + static_swizzle4_const(glm::i64vec2) + static_swizzle4_const(glm::i64vec3) + static_swizzle4_const(glm::i64vec4) - static_swizzle4_const(glm::u8vec2); - static_swizzle4_const(glm::u8vec3); - static_swizzle4_const(glm::u8vec4); - static_swizzle4_const(glm::u16vec2); - static_swizzle4_const(glm::u16vec3); - static_swizzle4_const(glm::u16vec4); - static_swizzle4_const(glm::u32vec2); - static_swizzle4_const(glm::u32vec3); - static_swizzle4_const(glm::u32vec4); - static_swizzle4_const(glm::u64vec2); - static_swizzle4_const(glm::u64vec3); - static_swizzle4_const(glm::u64vec4); + static_swizzle4_const(glm::u8vec2) + static_swizzle4_const(glm::u8vec3) + static_swizzle4_const(glm::u8vec4) + static_swizzle4_const(glm::u16vec2) + static_swizzle4_const(glm::u16vec3) + static_swizzle4_const(glm::u16vec4) + static_swizzle4_const(glm::u32vec2) + static_swizzle4_const(glm::u32vec3) + static_swizzle4_const(glm::u32vec4) + static_swizzle4_const(glm::u64vec2) + static_swizzle4_const(glm::u64vec3) + static_swizzle4_const(glm::u64vec4) # define static_swizzle2_ref(TYPE) \ template \ @@ -271,80 +271,80 @@ namespace glm inline glm::detail::tref4 swizzle(TYPE & v) \ {return glm::detail::tref4(v[x], v[y], v[z], v[w]);} - static_swizzle2_ref(glm::f16vec2); - static_swizzle2_ref(glm::f16vec3); - static_swizzle2_ref(glm::f16vec4); - static_swizzle2_ref(glm::f32vec2); - static_swizzle2_ref(glm::f32vec3); - static_swizzle2_ref(glm::f32vec4); - static_swizzle2_ref(glm::f64vec2); - static_swizzle2_ref(glm::f64vec3); - static_swizzle2_ref(glm::f64vec4); + static_swizzle2_ref(glm::f16vec2) + static_swizzle2_ref(glm::f16vec3) + static_swizzle2_ref(glm::f16vec4) + static_swizzle2_ref(glm::f32vec2) + static_swizzle2_ref(glm::f32vec3) + static_swizzle2_ref(glm::f32vec4) + static_swizzle2_ref(glm::f64vec2) + static_swizzle2_ref(glm::f64vec3) + static_swizzle2_ref(glm::f64vec4) - static_swizzle2_ref(glm::i8vec2); - static_swizzle2_ref(glm::i8vec3); - static_swizzle2_ref(glm::i8vec4); - static_swizzle2_ref(glm::i16vec2); - static_swizzle2_ref(glm::i16vec3); - static_swizzle2_ref(glm::i16vec4); - static_swizzle2_ref(glm::i32vec2); - static_swizzle2_ref(glm::i32vec3); - static_swizzle2_ref(glm::i32vec4); - static_swizzle2_ref(glm::i64vec2); - static_swizzle2_ref(glm::i64vec3); - static_swizzle2_ref(glm::i64vec4); + static_swizzle2_ref(glm::i8vec2) + static_swizzle2_ref(glm::i8vec3) + static_swizzle2_ref(glm::i8vec4) + static_swizzle2_ref(glm::i16vec2) + static_swizzle2_ref(glm::i16vec3) + static_swizzle2_ref(glm::i16vec4) + static_swizzle2_ref(glm::i32vec2) + static_swizzle2_ref(glm::i32vec3) + static_swizzle2_ref(glm::i32vec4) + static_swizzle2_ref(glm::i64vec2) + static_swizzle2_ref(glm::i64vec3) + static_swizzle2_ref(glm::i64vec4) - static_swizzle2_ref(glm::u8vec2); - static_swizzle2_ref(glm::u8vec3); - static_swizzle2_ref(glm::u8vec4); - static_swizzle2_ref(glm::u16vec2); - static_swizzle2_ref(glm::u16vec3); - static_swizzle2_ref(glm::u16vec4); - static_swizzle2_ref(glm::u32vec2); - static_swizzle2_ref(glm::u32vec3); - static_swizzle2_ref(glm::u32vec4); - static_swizzle2_ref(glm::u64vec2); - static_swizzle2_ref(glm::u64vec3); - static_swizzle2_ref(glm::u64vec4); + static_swizzle2_ref(glm::u8vec2) + static_swizzle2_ref(glm::u8vec3) + static_swizzle2_ref(glm::u8vec4) + static_swizzle2_ref(glm::u16vec2) + static_swizzle2_ref(glm::u16vec3) + static_swizzle2_ref(glm::u16vec4) + static_swizzle2_ref(glm::u32vec2) + static_swizzle2_ref(glm::u32vec3) + static_swizzle2_ref(glm::u32vec4) + static_swizzle2_ref(glm::u64vec2) + static_swizzle2_ref(glm::u64vec3) + static_swizzle2_ref(glm::u64vec4) - static_swizzle3_ref(glm::f16vec3); - static_swizzle3_ref(glm::f16vec4); - static_swizzle3_ref(glm::f32vec3); - static_swizzle3_ref(glm::f32vec4); - static_swizzle3_ref(glm::f64vec3); - static_swizzle3_ref(glm::f64vec4); + static_swizzle3_ref(glm::f16vec3) + static_swizzle3_ref(glm::f16vec4) + static_swizzle3_ref(glm::f32vec3) + static_swizzle3_ref(glm::f32vec4) + static_swizzle3_ref(glm::f64vec3) + static_swizzle3_ref(glm::f64vec4) - static_swizzle3_ref(glm::i8vec3); - static_swizzle3_ref(glm::i8vec4); - static_swizzle3_ref(glm::i16vec3); - static_swizzle3_ref(glm::i16vec4); - static_swizzle3_ref(glm::i32vec3); - static_swizzle3_ref(glm::i32vec4); - static_swizzle3_ref(glm::i64vec3); - static_swizzle3_ref(glm::i64vec4); + static_swizzle3_ref(glm::i8vec3) + static_swizzle3_ref(glm::i8vec4) + static_swizzle3_ref(glm::i16vec3) + static_swizzle3_ref(glm::i16vec4) + static_swizzle3_ref(glm::i32vec3) + static_swizzle3_ref(glm::i32vec4) + static_swizzle3_ref(glm::i64vec3) + static_swizzle3_ref(glm::i64vec4) - static_swizzle3_ref(glm::u8vec3); - static_swizzle3_ref(glm::u8vec4); - static_swizzle3_ref(glm::u16vec3); - static_swizzle3_ref(glm::u16vec4); - static_swizzle3_ref(glm::u32vec3); - static_swizzle3_ref(glm::u32vec4); - static_swizzle3_ref(glm::u64vec3); - static_swizzle3_ref(glm::u64vec4); + static_swizzle3_ref(glm::u8vec3) + static_swizzle3_ref(glm::u8vec4) + static_swizzle3_ref(glm::u16vec3) + static_swizzle3_ref(glm::u16vec4) + static_swizzle3_ref(glm::u32vec3) + static_swizzle3_ref(glm::u32vec4) + static_swizzle3_ref(glm::u64vec3) + static_swizzle3_ref(glm::u64vec4) - static_swizzle4_ref(glm::f16vec4); - static_swizzle4_ref(glm::f32vec4); - static_swizzle4_ref(glm::f64vec4); + static_swizzle4_ref(glm::f16vec4) + static_swizzle4_ref(glm::f32vec4) + static_swizzle4_ref(glm::f64vec4) - static_swizzle4_ref(glm::i8vec4); - static_swizzle4_ref(glm::i16vec4); - static_swizzle4_ref(glm::i32vec4); - static_swizzle4_ref(glm::i64vec4); + static_swizzle4_ref(glm::i8vec4) + static_swizzle4_ref(glm::i16vec4) + static_swizzle4_ref(glm::i32vec4) + static_swizzle4_ref(glm::i64vec4) - static_swizzle4_ref(glm::u8vec4); - static_swizzle4_ref(glm::u16vec4); - static_swizzle4_ref(glm::u32vec4); - static_swizzle4_ref(glm::u64vec4); + static_swizzle4_ref(glm::u8vec4) + static_swizzle4_ref(glm::u16vec4) + static_swizzle4_ref(glm::u32vec4) + static_swizzle4_ref(glm::u64vec4) }//namespace swizzle }//namespace gtc From 441f8a657569cd8a61ae78681dba62bb1c5ea2a2 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 21 Feb 2011 14:43:47 +0000 Subject: [PATCH 09/13] Factorised code, reduces number of warnings --- glm/core/_detail.hpp | 10 ++++++++++ glm/core/type_int.hpp | 35 +++++++---------------------------- glm/glm.hpp | 24 +++++++++++++----------- glm/setup.hpp | 1 + 4 files changed, 31 insertions(+), 39 deletions(-) diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index d11d7052..ed18de40 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -24,6 +24,16 @@ namespace detail #elif(GLM_COMPILER & GLM_COMPILER_GCC) __extension__ typedef signed long long sint64; __extension__ typedef unsigned long long uint64; +//# if GLM_MODEL == GLM_MODEL_64 +// typedef signed long highp_int_t; +// typedef unsigned long highp_uint_t; +//# elif GLM_MODEL == GLM_MODEL_32 +// __extension__ typedef signed long long highp_int_t; +// __extension__ typedef unsigned long long highp_uint_t; +//# endif//GLM_MODEL +#elif(GLM_COMPILER & GLM_COMPILER_BC) + typedef Int64 sint64; + typedef Uint64 uint64; #else//unknown compiler typedef signed long sint64; typedef unsigned long uint64; diff --git a/glm/core/type_int.hpp b/glm/core/type_int.hpp index e788d333..3f7aa0ab 100644 --- a/glm/core/type_int.hpp +++ b/glm/core/type_int.hpp @@ -17,26 +17,13 @@ namespace glm { namespace detail { -#if defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC) - typedef signed __int64 highp_int_t; - typedef unsigned __int64 highp_uint_t; -#elif(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_GCC)) - __extension__ typedef signed long long highp_int_t; - __extension__ typedef unsigned long long highp_uint_t; -//# if GLM_MODEL == GLM_MODEL_64 -// typedef signed long highp_int_t; -// typedef unsigned long highp_uint_t; -//# elif GLM_MODEL == GLM_MODEL_32 -// __extension__ typedef signed long long highp_int_t; -// __extension__ typedef unsigned long long highp_uint_t; -//# endif//GLM_MODEL -#elif(defined(GLM_COMPILER_BC)) - typedef Int64 highp_int_t; - typedef Uint64 highp_uint_t; -#else - typedef signed long long highp_int_t; - typedef unsigned long long highp_uint_t; -#endif//GLM_COMPILER + typedef signed short lowp_int_t; + typedef signed int mediump_int_t; + typedef sint64 highp_int_t; + + typedef unsigned short lowp_uint_t; + typedef unsigned int mediump_uint_t; + typedef uint64 highp_uint_t; GLM_DETAIL_IS_INT(signed char); GLM_DETAIL_IS_INT(signed short); @@ -49,14 +36,6 @@ namespace glm GLM_DETAIL_IS_UINT(unsigned int); GLM_DETAIL_IS_UINT(unsigned long); GLM_DETAIL_IS_UINT(highp_uint_t); - - typedef signed short lowp_int_t; - typedef signed int mediump_int_t; - typedef detail::highp_int_t highp_int_t; - - typedef unsigned short lowp_uint_t; - typedef unsigned int mediump_uint_t; - typedef detail::highp_uint_t highp_uint_t; } //namespace detail diff --git a/glm/glm.hpp b/glm/glm.hpp index a587e78c..67b20753 100644 --- a/glm/glm.hpp +++ b/glm/glm.hpp @@ -95,18 +95,20 @@ namespace glm //////////////////// // check type sizes -GLM_STATIC_ASSERT(sizeof(glm::detail::int8) == 1, "int8 size isn't 1 byte on this platform"); -GLM_STATIC_ASSERT(sizeof(glm::detail::int16) == 2, "int16 size isn't 2 bytes on this platform"); -GLM_STATIC_ASSERT(sizeof(glm::detail::int32) == 4, "int32 size isn't 4 bytes on this platform"); -GLM_STATIC_ASSERT(sizeof(glm::detail::int64) == 8, "int64 size isn't 8 bytes on this platform"); +#ifndef GLM_STATIC_ASSERT_NULL + GLM_STATIC_ASSERT(sizeof(glm::detail::int8) == 1, "int8 size isn't 1 byte on this platform"); + GLM_STATIC_ASSERT(sizeof(glm::detail::int16) == 2, "int16 size isn't 2 bytes on this platform"); + GLM_STATIC_ASSERT(sizeof(glm::detail::int32) == 4, "int32 size isn't 4 bytes on this platform"); + GLM_STATIC_ASSERT(sizeof(glm::detail::int64) == 8, "int64 size isn't 8 bytes on this platform"); -GLM_STATIC_ASSERT(sizeof(glm::detail::uint8) == 1, "uint8 size isn't 1 byte on this platform"); -GLM_STATIC_ASSERT(sizeof(glm::detail::uint16) == 2, "uint16 size isn't 2 bytes on this platform"); -GLM_STATIC_ASSERT(sizeof(glm::detail::uint32) == 4, "uint32 size isn't 4 bytes on this platform"); -GLM_STATIC_ASSERT(sizeof(glm::detail::uint64) == 8, "uint64 size isn't 8 bytes on this platform"); + GLM_STATIC_ASSERT(sizeof(glm::detail::uint8) == 1, "uint8 size isn't 1 byte on this platform"); + GLM_STATIC_ASSERT(sizeof(glm::detail::uint16) == 2, "uint16 size isn't 2 bytes on this platform"); + GLM_STATIC_ASSERT(sizeof(glm::detail::uint32) == 4, "uint32 size isn't 4 bytes on this platform"); + GLM_STATIC_ASSERT(sizeof(glm::detail::uint64) == 8, "uint64 size isn't 8 bytes on this platform"); -GLM_STATIC_ASSERT(sizeof(glm::detail::float16) == 2, "float16 size isn't 2 bytes on this platform"); -GLM_STATIC_ASSERT(sizeof(glm::detail::float32) == 4, "float32 size isn't 4 bytes on this platform"); -GLM_STATIC_ASSERT(sizeof(glm::detail::float64) == 8, "float64 size isn't 8 bytes on this platform"); + GLM_STATIC_ASSERT(sizeof(glm::detail::float16) == 2, "float16 size isn't 2 bytes on this platform"); + GLM_STATIC_ASSERT(sizeof(glm::detail::float32) == 4, "float32 size isn't 4 bytes on this platform"); + GLM_STATIC_ASSERT(sizeof(glm::detail::float64) == 8, "float64 size isn't 8 bytes on this platform"); +#endif//GLM_STATIC_ASSERT_NULL #endif //glm_glm diff --git a/glm/setup.hpp b/glm/setup.hpp index 65c4c071..29c9a2f8 100644 --- a/glm/setup.hpp +++ b/glm/setup.hpp @@ -365,6 +365,7 @@ # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] #else # define GLM_STATIC_ASSERT(x, message) +# define GLM_STATIC_ASSERT_NULL #endif//GLM_LANG /////////////////////////////////////////////////////////////////////////////////////////////////// From ce78b77f860a5cc7b7f46cd5d588fa6c575c07d7 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 21 Feb 2011 15:03:01 +0000 Subject: [PATCH 10/13] Improved alignment --- glm/core/_detail.hpp | 5 ++++- glm/gtx/simd_mat4.hpp | 2 +- glm/gtx/simd_vec4.hpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index ed18de40..55e4fc02 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -333,11 +333,13 @@ namespace detail #if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2005)) # define GLM_DEPRECATED __declspec(deprecated) # define GLM_ALIGN(x) __declspec(align(x)) +# define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct # define GLM_RESTRICT __declspec(restrict) # define GLM_RESTRICT_VAR __restrict #elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) # define GLM_DEPRECATED __attribute__((__deprecated__)) # define GLM_ALIGN(x) __attribute__((aligned(x))) +# define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) # if(GLM_COMPILER >= GLM_COMPILER_GCC33) # define GLM_RESTRICT __restrict__ # define GLM_RESTRICT_VAR __restrict__ @@ -349,7 +351,8 @@ namespace detail # define GLM_RESTRICT_VAR __restrict__ #else # define GLM_DEPRECATED -# define GLM_ALIGN(x) +# define GLM_ALIGN +# define GLM_ALIGNED_STRUCT(x) # define GLM_RESTRICT # define GLM_RESTRICT_VAR #endif//GLM_COMPILER diff --git a/glm/gtx/simd_mat4.hpp b/glm/gtx/simd_mat4.hpp index 9c85fd66..07ef9cf5 100644 --- a/glm/gtx/simd_mat4.hpp +++ b/glm/gtx/simd_mat4.hpp @@ -34,7 +34,7 @@ namespace glm { /// 4x4 Matrix implemented using SIMD SEE intrinsics. /// \ingroup gtx_simd_mat4 - GLM_ALIGN(16) struct fmat4x4SIMD + GLM_ALIGNED_STRUCT(16) fmat4x4SIMD { enum ctor{null}; diff --git a/glm/gtx/simd_vec4.hpp b/glm/gtx/simd_vec4.hpp index bfd1d5fa..83bba03b 100644 --- a/glm/gtx/simd_vec4.hpp +++ b/glm/gtx/simd_vec4.hpp @@ -34,7 +34,7 @@ namespace glm { /// 4-dimensional vector implemented using SIMD SEE intrinsics. /// \ingroup gtx_simd_vec4 - GLM_ALIGN(4) struct fvec4SIMD + GLM_ALIGNED_STRUCT(4) fvec4SIMD { enum ctor{null}; typedef __m128 value_type; From ad84fb61f5889d97c3ec4a43809bd5eef1f1e4f7 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 21 Feb 2011 15:23:10 +0000 Subject: [PATCH 11/13] Fixed ticket #44 with name collision --- glm/core/_fixes.hpp | 18 ++++++++++++++++++ glm/core/func_common.hpp | 2 ++ glm/glm.hpp | 14 +++----------- 3 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 glm/core/_fixes.hpp diff --git a/glm/core/_fixes.hpp b/glm/core/_fixes.hpp new file mode 100644 index 00000000..ba708003 --- /dev/null +++ b/glm/core/_fixes.hpp @@ -0,0 +1,18 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2011-02-21 +// Updated : 2011-02-21 +// Licence : This source is under MIT License +// File : glm/core/_fixes.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +//! Workaround for compatibility with other libraries +#ifdef max +#undef max +#endif + +//! Workaround for compatibility with other libraries +#ifdef min +#undef min +#endif diff --git a/glm/core/func_common.hpp b/glm/core/func_common.hpp index df3ac062..c9cdc8ba 100644 --- a/glm/core/func_common.hpp +++ b/glm/core/func_common.hpp @@ -10,6 +10,8 @@ #ifndef glm_core_func_common #define glm_core_func_common +#include "_fixes.hpp" + namespace glm { namespace test{ diff --git a/glm/glm.hpp b/glm/glm.hpp index 67b20753..26a182ba 100644 --- a/glm/glm.hpp +++ b/glm/glm.hpp @@ -7,19 +7,11 @@ // File : glm/glm.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// +#include "core/_fixes.hpp" + #ifndef glm_glm #define glm_glm -//! Workaround for compatibility with other libraries -#ifdef max -#undef max -#endif - -//! Workaround for compatibility with other libraries -#ifdef min -#undef min -#endif - //! TODO: to delete #define GLMvalType typename genType::value_type //#define GLMcolType typename genType::col_type @@ -29,7 +21,7 @@ #include #include #include -#include "./setup.hpp" +#include "setup.hpp" #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_CORE_INCLUDED_DISPLAYED)) # define GLM_MESSAGE_CORE_INCLUDED_DISPLAYED From ecdbdf753cc150e7a7afca83b5e3db0e94b7c554 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 21 Feb 2011 15:24:01 +0000 Subject: [PATCH 12/13] Fixed ticket #52, namespace collision --- glm/gtc/matrix_inverse.inl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glm/gtc/matrix_inverse.inl b/glm/gtc/matrix_inverse.inl index e27eb301..9cd81fa1 100644 --- a/glm/gtc/matrix_inverse.inl +++ b/glm/gtc/matrix_inverse.inl @@ -8,7 +8,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// namespace glm{ -namespace gtx{ +namespace gtc{ namespace matrix_inverse { template @@ -135,5 +135,5 @@ namespace matrix_inverse } }//namespace matrix_inverse -}//namespace gtx +}//namespace gtc }//namespace glm From 418088a947c204daa4af49366c4bdb856f81f70f Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 22 Feb 2011 01:22:38 +0000 Subject: [PATCH 13/13] Moved setup.hpp --- glm/core/_detail.hpp | 2 +- glm/core/intrinsic_common.hpp | 2 +- glm/core/intrinsic_geometric.hpp | 2 +- glm/{ => core}/setup.hpp | 0 glm/core/type_float.hpp | 2 +- glm/core/type_int.hpp | 2 +- glm/glm.hpp | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) rename glm/{ => core}/setup.hpp (100%) diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index 55e4fc02..9b36a921 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -10,7 +10,7 @@ #ifndef glm_core_detail #define glm_core_detail -#include "../setup.hpp" +#include "setup.hpp" #include namespace glm{ diff --git a/glm/core/intrinsic_common.hpp b/glm/core/intrinsic_common.hpp index 9028b4e7..ec2516e5 100644 --- a/glm/core/intrinsic_common.hpp +++ b/glm/core/intrinsic_common.hpp @@ -10,7 +10,7 @@ #ifndef glm_detail_intrinsic_common #define glm_detail_intrinsic_common -#include "../setup.hpp" +#include "setup.hpp" #if((GLM_ARCH & GLM_ARCH_SSE2) != GLM_ARCH_SSE2) # error "SSE2 instructions not supported or enabled" diff --git a/glm/core/intrinsic_geometric.hpp b/glm/core/intrinsic_geometric.hpp index 3791e6df..d640774b 100644 --- a/glm/core/intrinsic_geometric.hpp +++ b/glm/core/intrinsic_geometric.hpp @@ -10,7 +10,7 @@ #ifndef glm_core_intrinsic_geometric #define glm_core_intrinsic_geometric -#include "../setup.hpp" +#include "setup.hpp" #if((GLM_ARCH & GLM_ARCH_SSE2) != GLM_ARCH_SSE2) # error "SSE2 instructions not supported or enabled" diff --git a/glm/setup.hpp b/glm/core/setup.hpp similarity index 100% rename from glm/setup.hpp rename to glm/core/setup.hpp diff --git a/glm/core/type_float.hpp b/glm/core/type_float.hpp index 43aabb41..b62c7755 100644 --- a/glm/core/type_float.hpp +++ b/glm/core/type_float.hpp @@ -11,7 +11,7 @@ #define glm_core_type_float #include "type_half.hpp" -#include "../setup.hpp" +#include "setup.hpp" namespace glm { diff --git a/glm/core/type_int.hpp b/glm/core/type_int.hpp index 3f7aa0ab..6903c2b0 100644 --- a/glm/core/type_int.hpp +++ b/glm/core/type_int.hpp @@ -10,7 +10,7 @@ #ifndef glm_core_type_int #define glm_core_type_int -#include "../setup.hpp" +#include "setup.hpp" #include "_detail.hpp" namespace glm diff --git a/glm/glm.hpp b/glm/glm.hpp index 26a182ba..ac418334 100644 --- a/glm/glm.hpp +++ b/glm/glm.hpp @@ -21,7 +21,7 @@ #include #include #include -#include "setup.hpp" +#include "core/setup.hpp" #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_CORE_INCLUDED_DISPLAYED)) # define GLM_MESSAGE_CORE_INCLUDED_DISPLAYED