From f4d6be20649e97852d1956dae8c28471f46113df Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 9 Mar 2011 10:29:08 +0000 Subject: [PATCH 1/6] Added new default precision API --- glm/core/type_float.hpp | 23 +++++++++++------------ glm/core/type_int.hpp | 36 +++++++++++++++++------------------- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/glm/core/type_float.hpp b/glm/core/type_float.hpp index b62c7755..a615c0f3 100644 --- a/glm/core/type_float.hpp +++ b/glm/core/type_float.hpp @@ -46,7 +46,7 @@ namespace glm //! There is no guarantee on the actual precision. //! From GLSL 1.30.8 specification //! \ingroup core_precision - typedef mediump_float_t mediump_float; + typedef mediump_float_t mediump_float; //! High precision floating-point numbers. //! There is no guarantee on the actual precision. //! From GLSL 1.30.8 specification @@ -55,18 +55,17 @@ namespace glm } //namespace precision -#ifndef GLM_PRECISION - typedef precision::mediump_float float_t; -#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT) - typedef precision::highp_float float_t; -#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT) - typedef precision::mediump_float float_t; -#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT) - typedef precision::lowp_float float_t; +#if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) + typedef precision::mediump_float float_t; +#elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) + typedef precision::highp_float float_t; +#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) + typedef precision::mediump_float float_t; +#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT)) + typedef precision::lowp_float float_t; #else - # pragma message("GLM message: Precisson undefined for float numbers."); - typedef precision::mediump_float float_t; -#endif//GLM_PRECISION +# error "GLM error: multiple default precision requested for floating-point types" +#endif }//namespace type }//namespace core diff --git a/glm/core/type_int.hpp b/glm/core/type_int.hpp index 3bad8ce4..59abf8a4 100644 --- a/glm/core/type_int.hpp +++ b/glm/core/type_int.hpp @@ -54,7 +54,7 @@ namespace glm //! There is no guarantee on the actual precision. //! From GLSL 1.30.8 specification. //! \ingroup core_precision - typedef detail::mediump_int_t mediump_int; + typedef detail::mediump_int_t mediump_int; //! High precision signed integer. //! There is no guarantee on the actual precision. //! From GLSL 1.30.8 specification. @@ -75,35 +75,33 @@ namespace glm //! There is no guarantee on the actual precision. //! From GLSL 1.30.8 specification. //! \ingroup core_precision - typedef detail::highp_uint_t highp_uint; + typedef detail::highp_uint_t highp_uint; } //namespace precision -#ifndef GLM_PRECISION +#if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) typedef precision::mediump_int int_t; -#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT) - typedef precision::highp_int int_t; -#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT) +#elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) + typedef precision::highp_int int_t; +#elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT)) typedef precision::mediump_int int_t; -#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT) +#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT)) typedef precision::lowp_int int_t; #else - typedef precision::mediump_int int_t; -# pragma message("GLM message: Precisson undefined for signed integer number."); -#endif//GLM_PRECISION +# error "GLM error: multiple default precision requested for signed interger types" +#endif -#ifndef GLM_PRECISION +#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT)) typedef precision::mediump_uint uint_t; -#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT) - typedef precision::highp_uint uint_t; -#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT) +#elif(defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT)) + typedef precision::highp_uint uint_t; +#elif(!defined(GLM_PRECISION_HIGHP_UINT) && defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT)) typedef precision::mediump_uint uint_t; -#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT) - typedef precision::lowp_uint uint_t; +#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT)) + typedef precision::lowp_uint uint_t; #else - typedef precision::mediump_uint uint_t; -# pragma message("GLM message: Precisson undefined for unsigned integer number."); -#endif//GLM_PRECISION +# error "GLM error: multiple default precision requested for unsigned interger types" +#endif //! Unsigned integer. //! From GLSL 1.30.8 specification section 4.1.3 Integers. From e8a78c3998139feb8df2b5478e272cdeadb2dead Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 10 Mar 2011 00:45:28 +0000 Subject: [PATCH 2/6] Comment old precision API --- glm/core/setup.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index 8b335788..f411ddc0 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -403,7 +403,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// // Precision - +/* #define GLM_PRECISION_NONE 0x00000000 #define GLM_PRECISION_LOWP_FLOAT 0x00000011 @@ -417,5 +417,5 @@ #define GLM_PRECISION_LOWP_UINT 0x00110000 #define GLM_PRECISION_MEDIUMP_UINT 0x00120000 #define GLM_PRECISION_HIGHP_UINT 0x00130000 - +*/ #endif//glm_setup From e2f8c06e85d67838821895be33bc3f168182208c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 11 Mar 2011 01:28:28 +0000 Subject: [PATCH 3/6] Completed new precision API --- glm/core/setup.hpp | 17 ----------------- glm/core/type.hpp | 18 +++++++++--------- glm/gtc/matrix_integer.hpp | 17 ++++++----------- glm/gtx/vec1.hpp | 18 +++++++++--------- test/core/core_type_mat4x4.cpp | 1 + 5 files changed, 25 insertions(+), 46 deletions(-) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index f411ddc0..a7098d68 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -401,21 +401,4 @@ # endif #endif//GLM_MESSAGE -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Precision -/* -#define GLM_PRECISION_NONE 0x00000000 - -#define GLM_PRECISION_LOWP_FLOAT 0x00000011 -#define GLM_PRECISION_MEDIUMP_FLOAT 0x00000012 -#define GLM_PRECISION_HIGHP_FLOAT 0x00000013 - -#define GLM_PRECISION_LOWP_INT 0x00001100 -#define GLM_PRECISION_MEDIUMP_INT 0x00001200 -#define GLM_PRECISION_HIGHP_INT 0x00001300 - -#define GLM_PRECISION_LOWP_UINT 0x00110000 -#define GLM_PRECISION_MEDIUMP_UINT 0x00120000 -#define GLM_PRECISION_HIGHP_UINT 0x00130000 -*/ #endif//glm_setup diff --git a/glm/core/type.hpp b/glm/core/type.hpp index 599163ba..0117c3c4 100644 --- a/glm/core/type.hpp +++ b/glm/core/type.hpp @@ -38,7 +38,7 @@ namespace type ////////////////////////// // Float definition -#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT) +#if(defined(GLM_PRECISION_HIGHP_FLOAT)) typedef precision::highp_vec2 vec2; typedef precision::highp_vec3 vec3; typedef precision::highp_vec4 vec4; @@ -51,7 +51,7 @@ namespace type typedef precision::highp_mat4x2 mat4x2; typedef precision::highp_mat4x3 mat4x3; typedef precision::highp_mat4x4 mat4x4; -#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT) +#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) typedef precision::mediump_vec2 vec2; typedef precision::mediump_vec3 vec3; typedef precision::mediump_vec4 vec4; @@ -64,7 +64,7 @@ namespace type typedef precision::mediump_mat4x2 mat4x2; typedef precision::mediump_mat4x3 mat4x3; typedef precision::mediump_mat4x4 mat4x4; -#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT) +#elif(defined(GLM_PRECISION_LOWP_FLOAT)) typedef precision::lowp_vec2 vec2; typedef precision::lowp_vec3 vec3; typedef precision::lowp_vec4 vec4; @@ -158,15 +158,15 @@ namespace type ////////////////////////// // Signed integer definition -#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_INT) +#if(defined(GLM_PRECISION_HIGHP_INT)) typedef precision::highp_ivec2 ivec2; typedef precision::highp_ivec3 ivec3; typedef precision::highp_ivec4 ivec4; -#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT) +#elif(defined(GLM_PRECISION_MEDIUMP_INT)) typedef precision::mediump_ivec2 ivec2; typedef precision::mediump_ivec3 ivec3; typedef precision::mediump_ivec4 ivec4; -#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_INT) +#elif(defined(GLM_PRECISION_LOWP_INT)) typedef precision::lowp_ivec2 ivec2; typedef precision::lowp_ivec3 ivec3; typedef precision::lowp_ivec4 ivec4; @@ -190,15 +190,15 @@ namespace type ////////////////////////// // Unsigned integer definition -#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_UINT) +#if(defined(GLM_PRECISION_HIGHP_UINT)) typedef precision::highp_uvec2 uvec2; typedef precision::highp_uvec3 uvec3; typedef precision::highp_uvec4 uvec4; -#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT) +#elif(defined(GLM_PRECISION_MEDIUMP_UINT)) typedef precision::mediump_uvec2 uvec2; typedef precision::mediump_uvec3 uvec3; typedef precision::mediump_uvec4 uvec4; -#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_UINT) +#elif(defined(GLM_PRECISION_LOWP_UINT)) typedef precision::lowp_uvec2 uvec2; typedef precision::lowp_uvec3 uvec3; typedef precision::lowp_uvec4 uvec4; diff --git a/glm/gtc/matrix_integer.hpp b/glm/gtc/matrix_integer.hpp index 079dafc8..cfd487b8 100644 --- a/glm/gtc/matrix_integer.hpp +++ b/glm/gtc/matrix_integer.hpp @@ -117,11 +117,10 @@ namespace glm typedef detail::tmat4x3 lowp_umat4x3; //!< \brief Low-precision signed integer 4x3 matrix. (from GLM_GTC_matrix_integer extension) typedef detail::tmat4x4 lowp_umat4x4; //!< \brief Low-precision signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) -#if(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_HIGHP_INT)) +#if(defined(GLM_PRECISION_HIGHP_INT)) typedef highp_imat2 imat2; //!< \brief Signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension) typedef highp_imat3 imat3; //!< \brief Signed integer 3x3 matrix. (from GLM_GTC_matrix_integer extension) typedef highp_imat4 imat4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) - typedef highp_imat2x2 imat2x2; //!< \brief Signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension) typedef highp_imat2x3 imat2x3; //!< \brief Signed integer 2x3 matrix. (from GLM_GTC_matrix_integer extension) typedef highp_imat2x4 imat2x4; //!< \brief Signed integer 2x4 matrix. (from GLM_GTC_matrix_integer extension) @@ -131,8 +130,7 @@ namespace glm typedef highp_imat4x2 imat4x2; //!< \brief Signed integer 4x2 matrix. (from GLM_GTC_matrix_integer extension) typedef highp_imat4x3 imat4x3; //!< \brief Signed integer 4x3 matrix. (from GLM_GTC_matrix_integer extension) typedef highp_imat4x4 imat4x4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) - -#elif(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_LOWP_INT)) +#elif(defined(GLM_PRECISION_LOWP_INT)) typedef lowp_imat2 imat2; //!< \brief Signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension) typedef lowp_imat3 imat3; //!< \brief Signed integer 3x3 matrix. (from GLM_GTC_matrix_integer extension) typedef lowp_imat4 imat4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) @@ -145,8 +143,7 @@ namespace glm typedef lowp_imat4x2 imat4x2; //!< \brief Signed integer 4x2 matrix. (from GLM_GTC_matrix_integer extension) typedef lowp_imat4x3 imat4x3; //!< \brief Signed integer 4x3 matrix. (from GLM_GTC_matrix_integer extension) typedef lowp_imat4x4 imat4x4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) - -#else //if(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)) +#else //if(defined(GLM_PRECISION_MEDIUMP_INT)) typedef mediump_imat2 imat2; //!< \brief Signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension) typedef mediump_imat3 imat3; //!< \brief Signed integer 3x3 matrix. (from GLM_GTC_matrix_integer extension) typedef mediump_imat4 imat4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) @@ -161,7 +158,7 @@ namespace glm typedef mediump_imat4x4 imat4x4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) #endif//GLM_PRECISION -#if(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)) +#if(defined(GLM_PRECISION_HIGHP_UINT)) typedef highp_umat2 umat2; //!< \brief Unsigned integer 2x2 matrix. (from GLM_GTC_matrix_integer extension) typedef highp_umat3 umat3; //!< \brief Unsigned integer 3x3 matrix. (from GLM_GTC_matrix_integer extension) typedef highp_umat4 umat4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) @@ -174,8 +171,7 @@ namespace glm typedef highp_umat4x2 umat4x2; //!< \brief Unsigned integer 4x2 matrix. (from GLM_GTC_matrix_integer extension) typedef highp_umat4x3 umat4x3; //!< \brief Unsigned integer 4x3 matrix. (from GLM_GTC_matrix_integer extension) typedef highp_umat4x4 umat4x4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) - -#elif(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_LOWP_UINT)) +#elif(defined(GLM_PRECISION_LOWP_UINT)) typedef lowp_umat2 umat2; //!< \brief Unsigned integer 2x2 matrix. (from GLM_GTC_matrix_integer extension) typedef lowp_umat3 umat3; //!< \brief Unsigned integer 3x3 matrix. (from GLM_GTC_matrix_integer extension) typedef lowp_umat4 umat4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) @@ -188,8 +184,7 @@ namespace glm typedef lowp_umat4x2 umat4x2; //!< \brief Unsigned integer 4x2 matrix. (from GLM_GTC_matrix_integer extension) typedef lowp_umat4x3 umat4x3; //!< \brief Unsigned integer 4x3 matrix. (from GLM_GTC_matrix_integer extension) typedef lowp_umat4x4 umat4x4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) - -#else //if(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)) +#else //if(defined(GLM_PRECISION_MEDIUMP_UINT)) typedef mediump_umat2 umat2; //!< \brief Unsigned integer 2x2 matrix. (from GLM_GTC_matrix_integer extension) typedef mediump_umat3 umat3; //!< \brief Unsigned integer 3x3 matrix. (from GLM_GTC_matrix_integer extension) typedef mediump_umat4 umat4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension) diff --git a/glm/gtx/vec1.hpp b/glm/gtx/vec1.hpp index 0da37451..df7fb1d4 100644 --- a/glm/gtx/vec1.hpp +++ b/glm/gtx/vec1.hpp @@ -80,11 +80,11 @@ namespace glm //! From GLM_GTX_vec1 extension. typedef detail::tvec1 bvec1; -#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT) +#if(defined(GLM_PRECISION_HIGHP_FLOAT)) typedef precision::highp_vec1 vec1; -#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT) +#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) typedef precision::mediump_vec1 vec1; -#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT) +#elif(defined(GLM_PRECISION_LOWP_FLOAT)) typedef precision::lowp_vec1 vec1; #else //! 1 component vector of floating-point numbers. @@ -92,11 +92,11 @@ namespace glm typedef precision::mediump_vec1 vec1; #endif//GLM_PRECISION -#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_INT) +#if(defined(GLM_PRECISION_HIGHP_INT)) typedef precision::highp_ivec1 ivec1; -#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT) +#elif(defined(GLM_PRECISION_MEDIUMP_INT)) typedef precision::mediump_ivec1 ivec1; -#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_INT) +#elif(defined(GLM_PRECISION_LOWP_INT)) typedef precision::lowp_ivec1 ivec1; #else //! 1 component vector of signed integer numbers. @@ -104,11 +104,11 @@ namespace glm typedef precision::mediump_ivec1 ivec1; #endif//GLM_PRECISION -#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_UINT) +#if(defined(GLM_PRECISION_HIGHP_UINT)) typedef precision::highp_uvec1 uvec1; -#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT) +#elif(defined(GLM_PRECISION_MEDIUMP_UINT)) typedef precision::mediump_uvec1 uvec1; -#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_UINT) +#elif(defined(GLM_PRECISION_LOWP_UINT)) typedef precision::lowp_uvec1 uvec1; #else //! 1 component vector of unsigned integer numbers. diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index 65b85346..a821b91a 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -8,6 +8,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// #define GLM_MESSAGES +#define GLM_PRECISION_HIGHP_FLOAT #include #include From c6b7592246cbbb138d4bb06fb67fd83aa9124c06 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 11 Mar 2011 02:09:33 +0000 Subject: [PATCH 4/6] Added files for extension tests --- test/gtc/CMakeLists.txt | 11 +++++++++-- test/gtc/gtc_half_float.cpp | 19 +++++++++++++++++++ test/gtc/gtc_matrix_access.cpp | 19 +++++++++++++++++++ ...eger-matrix.cpp => gtc_matrix_integer.cpp} | 12 +----------- test/gtc/gtc_matrix_inverse.cpp | 19 +++++++++++++++++++ test/gtc/gtc_matrix_transform.cpp | 19 +++++++++++++++++++ test/gtc/gtc_quaternion.cpp | 19 +++++++++++++++++++ test/gtc/{gtc-swizzle.cpp => gtc_swizzle.cpp} | 2 +- test/gtc/gtc_type_precision.cpp | 19 +++++++++++++++++++ test/gtc/gtc_type_ptr.cpp | 19 +++++++++++++++++++ 10 files changed, 144 insertions(+), 14 deletions(-) create mode 100644 test/gtc/gtc_half_float.cpp create mode 100644 test/gtc/gtc_matrix_access.cpp rename test/gtc/{gtc-integer-matrix.cpp => gtc_matrix_integer.cpp} (81%) create mode 100644 test/gtc/gtc_matrix_inverse.cpp create mode 100644 test/gtc/gtc_matrix_transform.cpp create mode 100644 test/gtc/gtc_quaternion.cpp rename test/gtc/{gtc-swizzle.cpp => gtc_swizzle.cpp} (98%) create mode 100644 test/gtc/gtc_type_precision.cpp create mode 100644 test/gtc/gtc_type_ptr.cpp diff --git a/test/gtc/CMakeLists.txt b/test/gtc/CMakeLists.txt index 7dc18c00..aa58bcf0 100644 --- a/test/gtc/CMakeLists.txt +++ b/test/gtc/CMakeLists.txt @@ -1,2 +1,9 @@ -glmCreateTestGTC(gtc-integer-matrix) -glmCreateTestGTC(gtc-swizzle) \ No newline at end of file +glmCreateTestGTC(gtc_half_float) +glmCreateTestGTC(gtc_matrix_access) +glmCreateTestGTC(gtc_matrix_integer) +glmCreateTestGTC(gtc_matrix_inverse) +glmCreateTestGTC(gtc_matrix_transform) +glmCreateTestGTC(gtc_quaternion) +glmCreateTestGTC(gtc_swizzle) +glmCreateTestGTC(gtc_type_precision) +glmCreateTestGTC(gtc_type_ptr) diff --git a/test/gtc/gtc_half_float.cpp b/test/gtc/gtc_half_float.cpp new file mode 100644 index 00000000..0b9bc908 --- /dev/null +++ b/test/gtc/gtc_half_float.cpp @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2010-09-16 +// Updated : 2010-09-16 +// Licence : This source is under MIT licence +// File : test/gtc/matrix_transform.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GLM_MESSAGES +#include +#include + +int main() +{ + int Failed = 0; + + return Failed; +} diff --git a/test/gtc/gtc_matrix_access.cpp b/test/gtc/gtc_matrix_access.cpp new file mode 100644 index 00000000..0b9bc908 --- /dev/null +++ b/test/gtc/gtc_matrix_access.cpp @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2010-09-16 +// Updated : 2010-09-16 +// Licence : This source is under MIT licence +// File : test/gtc/matrix_transform.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GLM_MESSAGES +#include +#include + +int main() +{ + int Failed = 0; + + return Failed; +} diff --git a/test/gtc/gtc-integer-matrix.cpp b/test/gtc/gtc_matrix_integer.cpp similarity index 81% rename from test/gtc/gtc-integer-matrix.cpp rename to test/gtc/gtc_matrix_integer.cpp index b6b06c11..48686de0 100644 --- a/test/gtc/gtc-integer-matrix.cpp +++ b/test/gtc/gtc_matrix_integer.cpp @@ -4,26 +4,16 @@ // Created : 2010-09-16 // Updated : 2010-09-16 // Licence : This source is under MIT licence -// File : test/gtx/simd-mat4.cpp +// File : test/gtc/matrix_integer.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// #define GLM_MESSAGES #include #include -int test_int_matrix() -{ - { - glm::mediump_uint A(0); - } - - return 0; -} - int main() { int Failed = 0; - Failed += test_int_matrix(); return Failed; } diff --git a/test/gtc/gtc_matrix_inverse.cpp b/test/gtc/gtc_matrix_inverse.cpp new file mode 100644 index 00000000..0b9bc908 --- /dev/null +++ b/test/gtc/gtc_matrix_inverse.cpp @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2010-09-16 +// Updated : 2010-09-16 +// Licence : This source is under MIT licence +// File : test/gtc/matrix_transform.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GLM_MESSAGES +#include +#include + +int main() +{ + int Failed = 0; + + return Failed; +} diff --git a/test/gtc/gtc_matrix_transform.cpp b/test/gtc/gtc_matrix_transform.cpp new file mode 100644 index 00000000..0b9bc908 --- /dev/null +++ b/test/gtc/gtc_matrix_transform.cpp @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2010-09-16 +// Updated : 2010-09-16 +// Licence : This source is under MIT licence +// File : test/gtc/matrix_transform.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GLM_MESSAGES +#include +#include + +int main() +{ + int Failed = 0; + + return Failed; +} diff --git a/test/gtc/gtc_quaternion.cpp b/test/gtc/gtc_quaternion.cpp new file mode 100644 index 00000000..0b9bc908 --- /dev/null +++ b/test/gtc/gtc_quaternion.cpp @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2010-09-16 +// Updated : 2010-09-16 +// Licence : This source is under MIT licence +// File : test/gtc/matrix_transform.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GLM_MESSAGES +#include +#include + +int main() +{ + int Failed = 0; + + return Failed; +} diff --git a/test/gtc/gtc-swizzle.cpp b/test/gtc/gtc_swizzle.cpp similarity index 98% rename from test/gtc/gtc-swizzle.cpp rename to test/gtc/gtc_swizzle.cpp index 917976d6..0371c20a 100644 --- a/test/gtc/gtc-swizzle.cpp +++ b/test/gtc/gtc_swizzle.cpp @@ -4,7 +4,7 @@ // Created : 2010-09-16 // Updated : 2010-09-16 // Licence : This source is under MIT licence -// File : test/gtx/simd-mat4.cpp +// File : test/gtc/swizzle.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// #define GLM_MESSAGES diff --git a/test/gtc/gtc_type_precision.cpp b/test/gtc/gtc_type_precision.cpp new file mode 100644 index 00000000..0b9bc908 --- /dev/null +++ b/test/gtc/gtc_type_precision.cpp @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2010-09-16 +// Updated : 2010-09-16 +// Licence : This source is under MIT licence +// File : test/gtc/matrix_transform.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GLM_MESSAGES +#include +#include + +int main() +{ + int Failed = 0; + + return Failed; +} diff --git a/test/gtc/gtc_type_ptr.cpp b/test/gtc/gtc_type_ptr.cpp new file mode 100644 index 00000000..0b9bc908 --- /dev/null +++ b/test/gtc/gtc_type_ptr.cpp @@ -0,0 +1,19 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2010-09-16 +// Updated : 2010-09-16 +// Licence : This source is under MIT licence +// File : test/gtc/matrix_transform.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GLM_MESSAGES +#include +#include + +int main() +{ + int Failed = 0; + + return Failed; +} From b918e3ea3f559499fe74647363457b5ac9899b90 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 11 Mar 2011 02:15:15 +0000 Subject: [PATCH 5/6] Fixed pick function... again --- glm/gtc/matrix_transform.inl | 2 +- test/gtc/gtc_matrix_transform.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl index 93d845e6..cdf546c2 100644 --- a/glm/gtc/matrix_transform.inl +++ b/glm/gtc/matrix_transform.inl @@ -359,7 +359,7 @@ namespace matrix_transform // Translate and scale the picked region to the entire window Result = translate(Result, Temp); - return scale(Result, T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1)); + return scale(Result, detail::tvec3(T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1))); } template diff --git a/test/gtc/gtc_matrix_transform.cpp b/test/gtc/gtc_matrix_transform.cpp index 0b9bc908..1ca84115 100644 --- a/test/gtc/gtc_matrix_transform.cpp +++ b/test/gtc/gtc_matrix_transform.cpp @@ -14,6 +14,8 @@ int main() { int Failed = 0; + + glm::mat4 Pick = glm::pickMatrix(glm::vec2(1, 2), glm::vec2(3, 4), glm::ivec4(0, 0, 320, 240)); return Failed; } From 9f16d9e3e78e6c6d72ec3bc09ac7964b67736a8c Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 12 Mar 2011 03:01:52 +0000 Subject: [PATCH 6/6] Fixed warning with Clang C++, ticket #71 --- glm/core/func_integer.inl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glm/core/func_integer.inl b/glm/core/func_integer.inl index a07ed249..c5e6fe25 100644 --- a/glm/core/func_integer.inl +++ b/glm/core/func_integer.inl @@ -274,7 +274,7 @@ namespace glm Result |= (1 << (sizeof(genIUType) * 8 - 1)) & (1 << (Offset + Bits - 1)); genIUType Mask = 0; - for(std::size_t Bit = Offset; Bit < Bits; ++Bit) + for(int Bit = Offset; Bit < Bits; ++Bit) Mask |= (1 << Bit); return Result | ((Mask & Value) >> Offset); @@ -339,7 +339,7 @@ namespace glm return Base; genIUType Mask = 0; - for(std::size_t Bit = Offset; Bit < Offset + Bits; ++Bit) + for(int Bit = Offset; Bit < Offset + Bits; ++Bit) Mask |= (1 << Bit); return (Base & ~Mask) | (Insert & Mask);