diff --git a/doc/about.html b/doc/about.html index 892ba229..a91fb8b2 100644 --- a/doc/about.html +++ b/doc/about.html @@ -11,8 +11,8 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); -
OpenGL Mathematics
GLSL + Optional features = OpenGL Mathematics (GLM).
A C++ mathematics library for 3D graphics.


+
OpenGL Mathematics
GLSL + Optional features = OpenGL Mathematics (GLM).
A C++ mathematics library for 3D graphics.


OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specification.

diff --git a/doc/code.html b/doc/code.html index c424b184..aeb6d3a5 100644 --- a/doc/code.html +++ b/doc/code.html @@ -11,8 +11,8 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); -
OpenGL Mathematics
GLSL + Optional features = OpenGL Mathematics (GLM).
A C++ mathematics library for 3D graphics.


Compute a triangle normal:
  • #include <glm/glm.hpp>
  • void computeNormal(triangle & Triangle) +
    OpenGL Mathematics
    GLSL + Optional features = OpenGL Mathematics (GLM).
    A C++ mathematics library for 3D graphics.


    Compute a triangle normal:
    • #include <glm/glm.hpp>
    • void computeNormal(triangle & Triangle)
    • {
    • diff --git a/doc/download.html b/doc/download.html index 64430223..92d773ae 100644 --- a/doc/download.html +++ b/doc/download.html @@ -11,11 +11,12 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); -
      OpenGL Mathematics
      GLSL + Optional features = OpenGL Mathematics (GLM).
      A C++ mathematics library for 3D graphics.


      Current release
      17/03/2010: - GLM 0.9.1.1 +
      OpenGL Mathematics
      GLSL + Optional features = OpenGL Mathematics (GLM).
      A C++ mathematics library for 3D graphics.


      Current release
      12/04/2010: + GLM 0.9.1.2 (3.4 MB) -
      _________________

      GLM - zip files
      17/03/2010: GLM 0.9.1.1 (3.4 MB) +
      _________________

      GLM - zip files
      12/04/2010: GLM 0.9.1.2 (3.4 MB) +
      17/03/2010: GLM 0.9.1.1 (3.4 MB)
      03/03/2010: GLM 0.9.1.0 (3.4 MB)
      13/02/2010: GLM 0.9.1.B (3.4 MB)
      13/02/2010: GLM 0.9.0.8 (3.3 MB) @@ -70,7 +71,8 @@
      02/19/2006: GLM 0.3.0.0 (945 KB)
      05/05/2005: GLM 0.2.0.0 (194 KB)
      02/21/2005: GLM 0.1.0.0 (29.2 KB) -
      _________________

      GLM - 7z files
      17/03/2011: GLM 0.9.1.1 (2.1 MB) +
      _________________

      GLM - 7z files
      12/04/2011: GLM 0.9.1.2 (2.1 MB) +
      17/03/2011: GLM 0.9.1.1 (2.1 MB)
      03/03/2011: GLM 0.9.1.0 (2.1 MB)
      13/02/2011: GLM 0.9.1.B (2.1 MB)
      13/02/2011: GLM 0.9.0.8 (1.9 MB) diff --git a/doc/goodies.html b/doc/goodies.html index 02ce9e5e..ef3e35df 100644 --- a/doc/goodies.html +++ b/doc/goodies.html @@ -11,5 +11,5 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); -
      OpenGL Mathematics
      GLSL + Optional features = OpenGL Mathematics (GLM).
      A C++ mathematics library for 3D graphics.


      16/10/2008
      GLM Logo

      Download: 2560x1600
      Download: 1920x1200
      Download: 1600x1000
      Download: 1280x0800
      Download: 1024x0640

      _________________

      16/10/2008
      GLM Font

      Download: Font (.otf)

      _________________

      _________________

      Copyright © 2005 - 2011G-Truc Creation
      \ No newline at end of file +
      OpenGL Mathematics
      GLSL + Optional features = OpenGL Mathematics (GLM).
      A C++ mathematics library for 3D graphics.


      16/10/2008
      GLM Logo

      Download: 2560x1600
      Download: 1920x1200
      Download: 1600x1000
      Download: 1280x0800
      Download: 1024x0640

      _________________

      16/10/2008
      GLM Font

      Download: Font (.otf)

      _________________

      _________________

      Copyright © 2005 - 2011G-Truc Creation
      \ No newline at end of file diff --git a/doc/index.html b/doc/index.html index 61ac13eb..55a7ec7f 100644 --- a/doc/index.html +++ b/doc/index.html @@ -11,8 +11,8 @@ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); -
      OpenGL Mathematics
      GLSL + Optional features = OpenGL Mathematics (GLM).
      A C++ mathematics library for 3D graphics.


      +
      OpenGL Mathematics
      GLSL + Optional features = OpenGL Mathematics (GLM).
      A C++ mathematics library for 3D graphics.


      OpenGL Mathematics (GLM) is a header only C++ mathematics library for graphics software based on the OpenGL Shading Language (GLSL) specification.

      @@ -32,31 +32,33 @@

      Thanks for contributing to the project by submitting tickets for bug reports and feature requests. (SF.net account required). Any feedback is welcome at glm@g-truc.net. -


      17/03/2011 - GLM 0.9.1.1 released

      - GLM 0.9.1.1 fixes some bugs, warnings on Clang C++ and clean up a bit the code. -

      - If you have uncounter any issue with GLM 0.9.1.0, please download this revision. -

      - Finally, the work has started for GLM 0.9.2 so if you have requests don't forget to submit them!

      Download: GLM 0.9.1.1 (zip)
      Download: GLM 0.9.1.1 (7z)
      Link: Submit a bug report

      03/03/2011 - GLM 0.9.1.0 final released

      - Finally, GLM 0.9.1 branch is reaching the status of stable with - GLM 0.9.1.0. -

      - From GLM 0.9.1 beta, mainly bugs has been fixed. GLM has evolved on many sides since GLM 0.9.0: - Improved documentation (manual and doxygen), better test framework, simplified setup/options/configration of GLM and new experimental SIMD API. -

      - GLM 0.9.1.0 is not 100% backward compatile with - GLM 0.9.0.8 - but mainly advanced usages should be affected by the differencies. - Have a look at the GLM manual for more information on how to use GLM 0.9.1. -

      Download: GLM 0.9.1.0 (zip)
      Download: GLM 0.9.1.0 (7z)
      Link: GLM 0.9.1 manual
      Link: Submit a bug report

      13/02/2011 - GLM 0.9.0.8 and GLM 0.9.1 beta released

      - The stable version, GLM 0.9.0.8, adds the operator * for quaternion products and deprecated the cross function previously used for the same purpose. - Also, it clarifies that GLM is a header only library when a user try to build it. Once more, there is nothing to build. -

      - The development version, GLM 0.9.1 beta, provides an improved API documentation by - Alfonse Reinheart, - author of a great OpenGL tutorial which uses GLM. - This version also improves the SIMD extensions and it fixes many bugs. -

      Download: GLM 0.9.1.B (zip)
      Download: GLM 0.9.1.B (7z)
      Link: GLM 0.9.1 manual
      Download: GLM 0.9.0.8 (zip)
      Download: GLM 0.9.0.8 (7z)
      Link: GLM 0.9.0 manual
      Link: Submit a bug report

      31/01/2011 - GLM 0.9.1 alpha released

      +


      15/04/2011 - GLM 0.9.1.2 released

      + Bug fixes Only for GLM 0.9.1.2. +

      Download: GLM 0.9.1.2 (zip)
      Download: GLM 0.9.1.2 (7z)
      Link: Submit a bug report

      17/03/2011 - GLM 0.9.1.1 released

      + GLM 0.9.1.1 fixes some bugs, warnings on Clang C++ and clean up a bit the code. +

      + If you have uncounter any issue with GLM 0.9.1.0, please download this revision. +

      + Finally, the work has started for GLM 0.9.2 so if you have requests don't forget to submit them!

      Download: GLM 0.9.1.1 (zip)
      Download: GLM 0.9.1.1 (7z)
      Link: Submit a bug report

      03/03/2011 - GLM 0.9.1.0 final released

      + Finally, GLM 0.9.1 branch is reaching the status of stable with + GLM 0.9.1.0. +

      + From GLM 0.9.1 beta, mainly bugs has been fixed. GLM has evolved on many sides since GLM 0.9.0: + Improved documentation (manual and doxygen), better test framework, simplified setup/options/configration of GLM and new experimental SIMD API. +

      + GLM 0.9.1.0 is not 100% backward compatile with + GLM 0.9.0.8 + but mainly advanced usages should be affected by the differencies. + Have a look at the GLM manual for more information on how to use GLM 0.9.1. +

      Download: GLM 0.9.1.0 (zip)
      Download: GLM 0.9.1.0 (7z)
      Link: GLM 0.9.1 manual
      Link: Submit a bug report

      13/02/2011 - GLM 0.9.0.8 and GLM 0.9.1 beta released

      + The stable version, GLM 0.9.0.8, adds the operator * for quaternion products and deprecated the cross function previously used for the same purpose. + Also, it clarifies that GLM is a header only library when a user try to build it. Once more, there is nothing to build. +

      + The development version, GLM 0.9.1 beta, provides an improved API documentation by + Alfonse Reinheart, + author of a great OpenGL tutorial which uses GLM. + This version also improves the SIMD extensions and it fixes many bugs. +

      Download: GLM 0.9.1.B (zip)
      Download: GLM 0.9.1.B (7z)
      Link: GLM 0.9.1 manual
      Download: GLM 0.9.0.8 (zip)
      Download: GLM 0.9.0.8 (7z)
      Link: GLM 0.9.0 manual
      Link: Submit a bug report

      31/01/2011 - GLM 0.9.1 alpha released

      This new version of GLM is bringing a lot of improvements and maybe too many considering the development time it has required: API exposing SIMD implementation but also some new, safe and feature complet swizzling functions and a new setup API. All this is described in the largely updated GLM manual. diff --git a/doc/src/data.xml b/doc/src/data.xml index 2e68b38a..d44b6190 100644 --- a/doc/src/data.xml +++ b/doc/src/data.xml @@ -152,74 +152,74 @@ - - - Only bug fixes for GLM 0.9.1.2. - - - GLM 0.9.1.2 (zip) - GLM 0.9.1.2 (7z) - Submit a bug report - - - - - GLM 0.9.1.1 fixes some bugs, warnings on Clang C++ and clean up a bit the code. - - - If you have uncounter any issue with GLM 0.9.1.0, please download this revision. - - - Finally, the work has started for GLM 0.9.2 so if you have requests don't forget to submit them! - + + + Bug fixes Only for GLM 0.9.1.2. + + + GLM 0.9.1.2 (zip) + GLM 0.9.1.2 (7z) + Submit a bug report + + + + + GLM 0.9.1.1 fixes some bugs, warnings on Clang C++ and clean up a bit the code. + + + If you have uncounter any issue with GLM 0.9.1.0, please download this revision. + + + Finally, the work has started for GLM 0.9.2 so if you have requests don't forget to submit them! + GLM 0.9.1.1 (zip) GLM 0.9.1.1 (7z) Submit a bug report - - - - Finally, GLM 0.9.1 branch is reaching the status of stable with - GLM 0.9.1.0. - - - From GLM 0.9.1 beta, mainly bugs has been fixed. GLM has evolved on many sides since GLM 0.9.0: - Improved documentation (manual and doxygen), better test framework, simplified setup/options/configration of GLM and new experimental SIMD API. - - - GLM 0.9.1.0 is not 100% backward compatile with - GLM 0.9.0.8 - but mainly advanced usages should be affected by the differencies. - Have a look at the GLM manual for more information on how to use GLM 0.9.1. - - - GLM 0.9.1.0 (zip) - GLM 0.9.1.0 (7z) - GLM 0.9.1 manual - Submit a bug report - - - - - The stable version, GLM 0.9.0.8, adds the operator * for quaternion products and deprecated the cross function previously used for the same purpose. - Also, it clarifies that GLM is a header only library when a user try to build it. Once more, there is nothing to build. - - - The development version, GLM 0.9.1 beta, provides an improved API documentation by - Alfonse Reinheart, - author of a great OpenGL tutorial which uses GLM. - This version also improves the SIMD extensions and it fixes many bugs. - - GLM 0.9.1.B (zip) - GLM 0.9.1.B (7z) - GLM 0.9.1 manual - GLM 0.9.0.8 (zip) - GLM 0.9.0.8 (7z) - GLM 0.9.0 manual - Submit a bug report - + + + Finally, GLM 0.9.1 branch is reaching the status of stable with + GLM 0.9.1.0. + + + From GLM 0.9.1 beta, mainly bugs has been fixed. GLM has evolved on many sides since GLM 0.9.0: + Improved documentation (manual and doxygen), better test framework, simplified setup/options/configration of GLM and new experimental SIMD API. + + + GLM 0.9.1.0 is not 100% backward compatile with + GLM 0.9.0.8 + but mainly advanced usages should be affected by the differencies. + Have a look at the GLM manual for more information on how to use GLM 0.9.1. + + + GLM 0.9.1.0 (zip) + GLM 0.9.1.0 (7z) + GLM 0.9.1 manual + Submit a bug report + + + + + The stable version, GLM 0.9.0.8, adds the operator * for quaternion products and deprecated the cross function previously used for the same purpose. + Also, it clarifies that GLM is a header only library when a user try to build it. Once more, there is nothing to build. + + + The development version, GLM 0.9.1 beta, provides an improved API documentation by + Alfonse Reinheart, + author of a great OpenGL tutorial which uses GLM. + This version also improves the SIMD extensions and it fixes many bugs. + + + GLM 0.9.1.B (zip) + GLM 0.9.1.B (7z) + GLM 0.9.1 manual + GLM 0.9.0.8 (zip) + GLM 0.9.0.8 (7z) + GLM 0.9.0 manual + Submit a bug report + diff --git a/glm/core/func_matrix.inl b/glm/core/func_matrix.inl index acf6a792..d775d96b 100644 --- a/glm/core/func_matrix.inl +++ b/glm/core/func_matrix.inl @@ -466,8 +466,8 @@ namespace glm detail::tmat2x2 Inverse( + m[1][1] / Determinant, - - m[1][0] / Determinant, - m[0][1] / Determinant, + - m[1][0] / Determinant, + m[0][0] / Determinant); return Inverse; diff --git a/glm/gtx/simd_vec4.inl b/glm/gtx/simd_vec4.inl index 28364e4d..b6fb0fd8 100644 --- a/glm/gtx/simd_vec4.inl +++ b/glm/gtx/simd_vec4.inl @@ -275,7 +275,7 @@ namespace glm detail::fvec4SIMD const & x ) { - GLM_ALIGN(4) detail::tvec4 Result; + GLM_ALIGN(16) detail::tvec4 Result; _mm_store_ps(&Result[0], x.Data); return Result; } diff --git a/readme.txt b/readme.txt index f7a8d2ec..d85ec123 100644 --- a/readme.txt +++ b/readme.txt @@ -14,7 +14,7 @@ More informations in GLM manual: http://glm.g-truc.net/glm-0.9.1.pdf ================================================================================ -GLM 0.9.1.2: 2010-04-12 +GLM 0.9.1.2: 2010-04-15 -------------------------------------------------------------------------------- - Fixed bugs diff --git a/test/core/core_func_matrix.cpp b/test/core/core_func_matrix.cpp index 5c3f3cc0..a555f714 100644 --- a/test/core/core_func_matrix.cpp +++ b/test/core/core_func_matrix.cpp @@ -4,145 +4,79 @@ // Created : 2011-01-15 // Updated : 2011-01-15 // Licence : This source is under MIT licence -// File : test/gtx/simd-mat4.cpp +// File : test/core/func_matrix.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2 #include -int test_static_assert() +int test_matrixCompMult() { - //glm::lessThan(glm::mat4(0), glm::mat4(4)); - return 0; -} - -int test_lessThan_vec2() -{ - glm::bvec2 O = glm::bvec2(true, false); - - glm::bvec2 A = glm::lessThan(glm::vec2(0, 6), glm::vec2(4, 2)); - assert(glm::all(glm::equal(O, A))); - - glm::bvec2 B = glm::lessThan(glm::ivec2(0, 6), glm::ivec2(4, 2)); - assert(glm::all(glm::equal(O, B))); - - glm::bvec2 C = glm::lessThan(glm::uvec2(0, 6), glm::uvec2(4, 2)); - assert(glm::all(glm::equal(O, C))); - - return 0; -} - -int test_lessThan_vec3() -{ - glm::bvec3 O = glm::bvec3(true, true, false); - - glm::bvec3 A = glm::lessThan(glm::vec3(0, 1, 6), glm::vec3(4, 5, 2)); - assert(glm::all(glm::equal(O, A))); - - glm::bvec3 B = glm::lessThan(glm::ivec3(0, 1, 6), glm::ivec3(4, 5, 2)); - assert(glm::all(glm::equal(O, B))); - - glm::bvec3 C = glm::lessThan(glm::uvec3(0, 1, 6), glm::uvec3(4, 5, 2)); - assert(glm::all(glm::equal(O, C))); - - return 0; -} - -int test_lessThan_vec4() -{ - glm::bvec4 O = glm::bvec4(true, true, false, false); - - glm::bvec4 A = glm::lessThan(glm::vec4(0, 1, 6, 7), glm::vec4(4, 5, 2, 3)); - assert(glm::all(glm::equal(O, A))); - - glm::bvec4 B = glm::lessThan(glm::ivec4(0, 1, 6, 7), glm::ivec4(4, 5, 2, 3)); - assert(glm::all(glm::equal(O, B))); - - glm::bvec4 C = glm::lessThan(glm::uvec4(0, 1, 6, 7), glm::uvec4(4, 5, 2, 3)); - assert(glm::all(glm::equal(O, C))); return 0; } -int test_greaterThanEqual_vec2() +int test_outerProduct() { - glm::bvec2 O = glm::bvec2(false, true); - - glm::bvec2 A = glm::greaterThanEqual(glm::vec2(0, 6), glm::vec2(4, 2)); - assert(glm::all(glm::equal(O, A))); - glm::bvec2 B = glm::greaterThanEqual(glm::ivec2(0, 6), glm::ivec2(4, 2)); - assert(glm::all(glm::equal(O, B))); - - glm::bvec2 C = glm::greaterThanEqual(glm::uvec2(0, 6), glm::uvec2(4, 2)); - assert(glm::all(glm::equal(O, C))); return 0; } -int test_greaterThanEqual_vec3() +int test_transpose() { - glm::bvec3 O = glm::bvec3(false, false, true); - - glm::bvec3 A = glm::greaterThanEqual(glm::vec3(0, 1, 6), glm::vec3(4, 5, 2)); - assert(glm::all(glm::equal(O, A))); - glm::bvec3 B = glm::greaterThanEqual(glm::ivec3(0, 1, 6), glm::ivec3(4, 5, 2)); - assert(glm::all(glm::equal(O, B))); - - glm::bvec3 C = glm::greaterThanEqual(glm::uvec3(0, 1, 6), glm::uvec3(4, 5, 2)); - assert(glm::all(glm::equal(O, C))); return 0; } -int test_greaterThanEqual_vec4() +int test_determinant() { - glm::bvec4 O = glm::bvec4(false, false, true, true); - - glm::bvec4 A = glm::greaterThanEqual(glm::vec4(0, 1, 6, 7), glm::vec4(4, 5, 2, 3)); - assert(glm::all(glm::equal(O, A))); - glm::bvec4 B = glm::greaterThanEqual(glm::ivec4(0, 1, 6, 7), glm::ivec4(4, 5, 2, 3)); - assert(glm::all(glm::equal(O, B))); - - glm::bvec4 C = glm::greaterThanEqual(glm::uvec4(0, 1, 6, 7), glm::uvec4(4, 5, 2, 3)); - assert(glm::all(glm::equal(O, C))); return 0; } -int test_all() +int test_inverse() { - assert(glm::all(glm::bvec2(true, true))); - assert(!glm::all(glm::bvec2(true, false))); - assert(!glm::all(glm::bvec2(false, false))); - - assert(glm::all(glm::bvec3(true, true, true))); - assert(!glm::all(glm::bvec3(true, false, true))); - assert(!glm::all(glm::bvec3(false, false, false))); + int Failed(0); + + glm::mat4x4 A4x4( + glm::vec4(1, 0, 1, 0), + glm::vec4(0, 1, 0, 0), + glm::vec4(0, 0, 1, 0), + glm::vec4(0, 0, 0, 1)); + glm::mat4x4 B4x4 = glm::inverse(A4x4); + glm::mat4x4 I4x4 = A4x4 * B4x4; + Failed += I4x4 == glm::mat4x4(1) ? 0 : 1; + + glm::mat3x3 A3x3( + glm::vec3(1, 0, 1), + glm::vec3(0, 1, 0), + glm::vec3(0, 0, 1)); + glm::mat3x3 B3x3 = glm::inverse(A3x3); + glm::mat3x3 I3x3 = A3x3 * B3x3; + Failed += I3x3 == glm::mat3x3(1) ? 0 : 1; + + glm::mat2x2 A2x2( + glm::vec2(1, 1), + glm::vec2(0, 1)); + glm::mat2x2 B2x2 = glm::inverse(A2x2); + glm::mat2x2 I2x2 = A2x2 * B2x2; + Failed += I2x2 == glm::mat2x2(1) ? 0 : 1; - assert(glm::all(glm::bvec4(true, true, true, true))); - assert(!glm::all(glm::bvec4(true, false, true, false))); - assert(!glm::all(glm::bvec4(false, false, false, false))); - - return 0; + return Failed; } int main() { int Failed = 0; - Failed += test_static_assert(); - Failed += test_lessThan_vec2(); - Failed += test_lessThan_vec3(); - Failed += test_lessThan_vec4(); - Failed += test_greaterThanEqual_vec2(); - Failed += test_greaterThanEqual_vec3(); - Failed += test_greaterThanEqual_vec4(); - Failed += test_all(); - + Failed += test_matrixCompMult(); + Failed += test_outerProduct(); + Failed += test_transpose(); + Failed += test_determinant(); + Failed += test_inverse(); return Failed; } diff --git a/test/core/core_type_mat2x2.cpp b/test/core/core_type_mat2x2.cpp index ce188d8a..23b6bd81 100644 --- a/test/core/core_type_mat2x2.cpp +++ b/test/core/core_type_mat2x2.cpp @@ -9,7 +9,7 @@ #include -static bool test_operators() +static int test_operators() { glm::mat2x2 m(1.0f); glm::vec2 u(1.0f); @@ -24,15 +24,14 @@ static bool test_operators() bool R = m != q; bool S = m == m; - return true; + return (S && !R) ? 0 : 1; } int main() { - bool Result = true; + int Error = 0; - Result = Result && test_operators(); + Error += test_operators(); - assert(Result); - return Result; + return Error; } diff --git a/test/core/core_type_mat2x3.cpp b/test/core/core_type_mat2x3.cpp index 92331d8e..f6311b96 100644 --- a/test/core/core_type_mat2x3.cpp +++ b/test/core/core_type_mat2x3.cpp @@ -9,7 +9,7 @@ #include -static bool test_operators() +static int test_operators() { glm::mat2x3 m(1.0f); glm::vec2 u(1.0f); @@ -24,15 +24,14 @@ static bool test_operators() bool R = m != q; bool S = m == m; - return true; + return (S && !R) ? 0 : 1; } int main() { - bool Result = true; + int Error = 0; - Result = Result && test_operators(); + Error += test_operators(); - assert(Result); - return Result; + return Error; } diff --git a/test/core/core_type_mat2x4.cpp b/test/core/core_type_mat2x4.cpp index f13db087..fad79409 100644 --- a/test/core/core_type_mat2x4.cpp +++ b/test/core/core_type_mat2x4.cpp @@ -9,7 +9,7 @@ #include -static bool test_operators() +static int test_operators() { glm::mat2x4 m(1.0f); glm::vec2 u(1.0f); @@ -24,17 +24,17 @@ static bool test_operators() bool R = m != q; bool S = m == m; - return true; + return (S && !R) ? 0 : 1; } int main() { - bool Result = true; + int Error = 0; - Result = Result && test_operators(); + Error += test_operators(); - assert(Result); - return Result; + return Error; } + diff --git a/test/core/core_type_mat3x2.cpp b/test/core/core_type_mat3x2.cpp index 8e9c8da8..7193cd8a 100644 --- a/test/core/core_type_mat3x2.cpp +++ b/test/core/core_type_mat3x2.cpp @@ -24,16 +24,16 @@ static bool test_operators() bool R = m != q; bool S = m == m; - return true; + return (S && !R) ? 0 : 1; } int main() { - bool Result = true; + int Error = 0; - Result = Result && test_operators(); + Error += test_operators(); - assert(Result); - return Result; + return Error; } + diff --git a/test/core/core_type_mat3x3.cpp b/test/core/core_type_mat3x3.cpp index 4daa1929..26a4933c 100644 --- a/test/core/core_type_mat3x3.cpp +++ b/test/core/core_type_mat3x3.cpp @@ -18,7 +18,7 @@ void print(glm::dmat3 const & Mat0) printf("\tvec3(%2.3f, %2.3f, %2.3f))\n\n", Mat0[2][0], Mat0[2][1], Mat0[2][2]); } -bool test_mat3x3() +int test_mat3x3() { glm::dmat3 Mat0( glm::dvec3(0.6f, 0.2f, 0.3f), @@ -31,10 +31,10 @@ bool test_mat3x3() print(Inv0); print(Res0); - return true; + return 0; } -static bool test_operators() +static int test_operators() { glm::mat3x3 m(1.0f); glm::vec3 u(1.0f); @@ -49,17 +49,16 @@ static bool test_operators() bool R = m != q; bool S = m == m; - return true; + return (S && !R) ? 0 : 1; } int main() { - bool Result = true; + int Error = 0; - Result = Result && test_mat3x3(); - Result = Result && test_operators(); + Error += test_mat3x3(); + Error += test_operators(); - assert(Result); - return Result; + return Error; } diff --git a/test/core/core_type_mat3x4.cpp b/test/core/core_type_mat3x4.cpp index 69a0ccad..8e36b67a 100644 --- a/test/core/core_type_mat3x4.cpp +++ b/test/core/core_type_mat3x4.cpp @@ -24,16 +24,15 @@ static bool test_operators() bool R = m != q; bool S = m == m; - return true; + return (S && !R) ? 0 : 1; } int main() { - bool Result = true; + int Error = 0; - Result = Result && test_operators(); + Error += test_operators(); - assert(Result); - return Result; + return Error; } diff --git a/test/core/core_type_mat4x2.cpp b/test/core/core_type_mat4x2.cpp index 83a69d40..989acee1 100644 --- a/test/core/core_type_mat4x2.cpp +++ b/test/core/core_type_mat4x2.cpp @@ -9,7 +9,7 @@ #include -static bool test_operators() +static int test_operators() { glm::mat4x2 m(1.0f); glm::vec4 u(1.0f); @@ -24,16 +24,15 @@ static bool test_operators() bool R = m != q; bool S = m == m; - return true; + return (S && !R) ? 0 : 1; } int main() { - bool Result = true; + int Error = 0; - Result = Result && test_operators(); + Error += test_operators(); - assert(Result); - return Result; + return Error; } diff --git a/test/core/core_type_mat4x3.cpp b/test/core/core_type_mat4x3.cpp index 893b67a4..cc46e8d4 100644 --- a/test/core/core_type_mat4x3.cpp +++ b/test/core/core_type_mat4x3.cpp @@ -9,7 +9,7 @@ #include -static bool test_operators() +static int test_operators() { glm::mat4x3 m(1.0f); glm::vec4 u(1.0f); @@ -24,17 +24,16 @@ static bool test_operators() bool R = m != q; bool S = m == m; - return true; + return (S && !R) ? 0 : 1; } int main() { - bool Result = true; + int Error = 0; - Result = Result && test_operators(); + Error += test_operators(); - assert(Result); - return Result; + return Error; } diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index a821b91a..7028d280 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -21,7 +21,7 @@ void print(glm::dmat4 const & Mat0) printf("\tvec4(%2.3f, %2.3f, %2.3f, %2.3f))\n\n", Mat0[3][0], Mat0[3][1], Mat0[3][2], Mat0[3][3]); } -bool test_mat4x4() +int test_mat4x4() { glm::dmat4 Mat0( glm::dvec4(0.6f, 0.2f, 0.3f, 0.4f), @@ -35,7 +35,7 @@ bool test_mat4x4() print(Inv0); print(Res0); - return true; + return 0; } static bool test_operators() @@ -53,16 +53,15 @@ static bool test_operators() bool R = m != q; bool S = m == m; - return true; + return (S && !R) ? 0 : 1; } int main() { - bool Result = true; + int Error = 0; - Result = Result && test_mat4x4(); - Result = Result && test_operators(); - - assert(Result); - return Result; + Error += test_mat4x4(); + Error += test_operators(); + + return Error; } diff --git a/test/core/core_type_vec1.cpp b/test/core/core_type_vec1.cpp index 9d31fcdd..fddd6a47 100644 --- a/test/core/core_type_vec1.cpp +++ b/test/core/core_type_vec1.cpp @@ -9,22 +9,21 @@ #include -static bool test_operators() +static int test_operators() { glm::vec4 A(1.0f); glm::vec4 B(1.0f); bool R = A != B; bool S = A == B; - return true; + return (S && !R) ? 0 : 1; } int main() { - bool Result = true; + int Error = 0; - Result = Result && test_operators(); + Error += test_operators(); - assert(Result); - return Result; + return Error; } diff --git a/test/core/core_type_vec2.cpp b/test/core/core_type_vec2.cpp index ab9db689..00c48a99 100644 --- a/test/core/core_type_vec2.cpp +++ b/test/core/core_type_vec2.cpp @@ -9,22 +9,21 @@ #include -static bool test_operators() +static int test_operators() { - glm::vec4 A(1.0f); - glm::vec4 B(1.0f); + glm::vec2 A(1.0f); + glm::vec2 B(1.0f); bool R = A != B; bool S = A == B; - return true; + return (S && !R) ? 0 : 1; } int main() { - bool Result = true; + int Error = 0; - Result = Result && test_operators(); - - assert(Result); - return Result; + Error += test_operators(); + + return Error; } diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index 5b2f20f1..a2b7ec49 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -9,22 +9,21 @@ #include -static bool test_operators() +static int test_operators() { - glm::vec4 A(1.0f); - glm::vec4 B(1.0f); + glm::vec3 A(1.0f); + glm::vec3 B(1.0f); bool R = A != B; bool S = A == B; - return true; + return (S && !R) ? 0 : 1; } int main() { - bool Result = true; + int Error = 0; - Result = Result && test_operators(); + Error += test_operators(); - assert(Result); - return Result; + return Error; } diff --git a/test/core/core_type_vec4.cpp b/test/core/core_type_vec4.cpp index 2edb4645..dd0769bb 100644 --- a/test/core/core_type_vec4.cpp +++ b/test/core/core_type_vec4.cpp @@ -31,41 +31,34 @@ enum comp // return _mm_shuffle_ps(Src, Src, mask<(int(W) << 6) | (int(Z) << 4) | (int(Y) << 2) | (int(X) << 0)>::value); //} -bool test_hvec4() +int test_hvec4() { glm::hvec4 const A = glm::hvec4(0, 1, 2, 3); //glm::hvec4 B = glm::swizzle(A); //glm::vec4 B = glm::detail::tvec##(glm::vec4::_size)(); - return true; + return 0; } -static bool test_operators() +static int test_operators() { glm::vec4 A(1.0f); glm::vec4 B(1.0f); bool R = A != B; bool S = A == B; - return true; + return (S && !R) ? 0 : 1; } 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)); - bool Result = true; - - Result = Result && test_operators(); - Result = Result && test_hvec4(); - - assert(Result); - return Result; - - return 0; + int Error = 0; + Error += test_operators(); + Error += test_hvec4(); + return Error; } diff --git a/test/gtc/gtc_quaternion.cpp b/test/gtc/gtc_quaternion.cpp index 0b9bc908..c018ae68 100644 --- a/test/gtc/gtc_quaternion.cpp +++ b/test/gtc/gtc_quaternion.cpp @@ -13,7 +13,7 @@ int main() { - int Failed = 0; + int Error = -1; - return Failed; + return Error; } diff --git a/test/gtc/gtc_swizzle.cpp b/test/gtc/gtc_swizzle.cpp index 0371c20a..70f266a5 100644 --- a/test/gtc/gtc_swizzle.cpp +++ b/test/gtc/gtc_swizzle.cpp @@ -13,114 +13,122 @@ int test_swizzle_vec4_ref_dynamic() { + int Error = 0; + { glm::ivec4 A(0, 1, 2, 3); glm::ivec4 B(2, 1, 0, 3); glm::swizzle(A, glm::Z, glm::Y, glm::X, glm::W) = B; - assert(A.x == B.x && A.y == B.y && A.z == B.z && A.w == B.w); + Error += (A.z == B.x && A.y == B.y && A.x == B.z && A.w == B.w) ? 0 : 1; } { glm::ivec4 A(0, 1, 2, 3); glm::ivec3 B(2, 1, 0); glm::swizzle(A, glm::Z, glm::Y, glm::X) = B; - assert(A.x == B.x && A.y == B.y && A.z == B.z); + Error += (A.z == B.x && A.y == B.y && A.x == B.z) ? 0 : 1; } { glm::ivec4 A(0, 1, 2, 3); glm::ivec2 B(2, 1); glm::swizzle(A, glm::Z, glm::Y) = B; - assert(A.x == B.x && A.y == B.y); + Error += (A.z == B.x && A.y == B.y) ? 0 : 1; } { glm::ivec4 A(0, 1, 2, 3); int B(2); glm::swizzle(A, glm::Z) = B; - assert(A.x == B); + Error += (A.z == B) ? 0 : 1; } - return 0; + return Error; } int test_swizzle_vec4_ref_static() { + int Error = 0; + { glm::ivec4 A(0, 1, 2, 3); glm::ivec4 B(2, 1, 0, 3); glm::swizzle(A) = B; - assert(A.x == B.x && A.y == B.y && A.z == B.z && A.w == B.w); + Error += (A.z == B.x && A.y == B.y && A.x == B.z && A.w == B.w) ? 0 : 1; } { glm::ivec4 A(0, 1, 2, 3); glm::ivec3 B(2, 1, 0); glm::swizzle(A) = B; - assert(A.x == B.x && A.y == B.y && A.z == B.z); + Error += (A.z == B.x && A.y == B.y && A.x == B.z) ? 0 : 1; } { glm::ivec4 A(0, 1, 2, 3); glm::ivec2 B(2, 1); glm::swizzle(A) = B; - assert(A.x == B.x && A.y == B.y); + Error += (A.z == B.x && A.y == B.y) ? 0 : 1; } { glm::ivec4 A(0, 1, 2, 3); int B(2); glm::swizzle(A) = B; - assert(A.x == B); + Error += (A.z == B) ? 0 : 1; } - return 0; + return Error; } int test_swizzle_vec4_const_dynamic() { + int Error = 0; + glm::ivec4 A(0, 1, 2, 3); glm::ivec4 B = glm::swizzle(A, glm::B, glm::G, glm::R, glm::A); - assert(glm::all(glm::equal(A, B))); + Error += (glm::all(glm::equal(glm::ivec4(2, 1, 0, 3), B))) ? 0 : 1; glm::ivec3 C = glm::swizzle(A, glm::W, glm::Y, glm::Z); - assert(glm::all(glm::equal(glm::ivec3(A), C))); + Error += (glm::all(glm::equal(glm::ivec3(3, 1, 2), C))) ? 0 : 1; glm::ivec2 D = glm::swizzle(A, glm::W, glm::X); - assert(glm::all(glm::equal(glm::ivec2(A), D))); + Error += (glm::all(glm::equal(glm::ivec2(3, 0), D))) ? 0 : 1; int E = glm::swizzle(A, glm::Q); - assert(E == A.q); + Error += (E == 3) ? 0 : 1; - return 0; + return Error; } int test_swizzle_vec4_const_static() { + int Error = 0; + glm::ivec4 A(0, 1, 2, 3); glm::ivec4 B = glm::swizzle(A); - assert(glm::all(glm::equal(A, B))); + Error += (glm::all(glm::equal(glm::ivec4(2, 1, 0, 3), B))) ? 0 : 1; glm::ivec3 C = glm::swizzle(A); - assert(glm::all(glm::equal(glm::ivec3(A), C))); + Error += (glm::all(glm::equal(glm::ivec3(3, 1, 2), C))) ? 0 : 1; glm::ivec2 D = glm::swizzle(A); - assert(glm::all(glm::equal(glm::ivec2(A), D))); + Error += (glm::all(glm::equal(glm::ivec2(3, 0), D))) ? 0 : 1; int E = glm::swizzle(A); - assert(E == A.q); + Error += (E == 3) ? 0 : 1; - return 0; + return Error; } int main() { - int Failed = 0; - Failed += test_swizzle_vec4_ref_dynamic(); - Failed += test_swizzle_vec4_ref_static(); - Failed += test_swizzle_vec4_const_dynamic(); - Failed += test_swizzle_vec4_const_static(); + int Error = 0; + Error += test_swizzle_vec4_ref_dynamic(); + Error += test_swizzle_vec4_ref_static(); + Error += test_swizzle_vec4_const_dynamic(); + Error += test_swizzle_vec4_const_static(); - return Failed; + return Error; } diff --git a/test/gtx/gtx-bit.cpp b/test/gtx/gtx-bit.cpp index 99bb586f..7133b60f 100644 --- a/test/gtx/gtx-bit.cpp +++ b/test/gtx/gtx-bit.cpp @@ -129,6 +129,8 @@ namespace bitRevert int main() { - ::extractField::test(); - ::bitRevert::test(); + bool Error = 0; + Error += ::extractField::test(); + Error += ::bitRevert::test(); + return Error; } diff --git a/test/gtx/gtx-simd-mat4.cpp b/test/gtx/gtx-simd-mat4.cpp index ae976be5..07019e90 100644 --- a/test/gtx/gtx-simd-mat4.cpp +++ b/test/gtx/gtx-simd-mat4.cpp @@ -224,14 +224,14 @@ int test_compute_gtx() std::clock_t TimeEnd = clock(); printf("test_compute_gtx: %ld\n", TimeEnd - TimeStart); - return Output.size() != 0; + return 0; } int main() { - int Failed = GLM_COMPILER; + int Error = 0; - std::vector Data(1024 * 1024 * 8); + std::vector Data(64 * 64 * 1); for(std::size_t i = 0; i < Data.size(); ++i) Data[i] = glm::mat4( glm::vec4(glm::compRand4(-2.0f, 2.0f)), @@ -277,13 +277,11 @@ int main() glm::simdVec4 B(5.0f, 6.0f, 7.0f, 8.0f); __m128 C = _mm_shuffle_ps(A.Data, B.Data, _MM_SHUFFLE(1, 0, 1, 0)); - Failed += test_compute_glm(); - Failed += test_compute_gtx(); + Error += test_compute_glm(); + Error += test_compute_gtx(); float Det = glm::determinant(glm::simdMat4(1.0)); glm::simdMat4 D = glm::matrixCompMult(glm::simdMat4(1.0), glm::simdMat4(1.0)); - system("pause"); - - return Failed; + return Error; }