From c866207fe046c941f6d3114720a3df1671163341 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 8 Jul 2010 10:44:50 +0100 Subject: [PATCH 1/6] Fixed ticket #23 --- doc/src/dummy.cpp | 22 +++++++++++++++++++++- glm/gtx/comparison.hpp | 40 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 57 insertions(+), 5 deletions(-) diff --git a/doc/src/dummy.cpp b/doc/src/dummy.cpp index 7188c829..226a7c76 100644 --- a/doc/src/dummy.cpp +++ b/doc/src/dummy.cpp @@ -1,4 +1,5 @@ #include "../../glm/glm.hpp" // glm::vec3, glm::vec4, glm::ivec4, glm::mat4 +#include struct triangle { @@ -17,12 +18,29 @@ void computeNormal(triangle & Triangle) #include "../../glm/gtc/matrix_projection.hpp" // glm::perspective #include "../../glm/gtc/matrix_transform.hpp" // glm::translate, glm::rotate, glm::scale #include "../../glm/gtc/type_ptr.hpp" // glm::value_ptr +#include "../../glm/gtc/quaternion.hpp" // glm::quat +#include "../../glm/gtx/comparison.hpp" // == != +//#include "../../glm/ext.hpp" glm::vec4 const ClearColor = glm::vec4(glm::vec3(0.0f), 1.0f); glm::ivec4 const Viewport = glm::ivec4(0, 0, 640, 480); void glUniformMatrix4fv(int location, int count, bool transpose, const float * value); +void ticket0023() +{ + std::vector vals; + vals.push_back(1); + vals.push_back(2); + vals.push_back(3); + std::vector::iterator it1, it2; + it1 = vals.begin(); + it2 = vals.end(); + it1 != it2; // <-- Here + glm::vec3 c; + glm::quat q; +} + int main() { //triangle Triangle; @@ -38,5 +56,7 @@ int main() glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); glm::mat4 MVP = Projection * View * Model; - glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP)); + //glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP)); + + ticket0023(); } diff --git a/glm/gtx/comparison.hpp b/glm/gtx/comparison.hpp index 8d12d5f6..a035e936 100644 --- a/glm/gtx/comparison.hpp +++ b/glm/gtx/comparison.hpp @@ -28,13 +28,45 @@ namespace glm //! Define == operator for vectors //! From GLM_GTX_comparison extension. - template - bool operator== (vecType const & x, vecType const & y); + template + bool operator== ( + detail::tvec2 const & x, + detail::tvec2 const & y); + + //! Define == operator for vectors + //! From GLM_GTX_comparison extension. + template + bool operator== ( + detail::tvec3 const & x, + detail::tvec3 const & y); + + //! Define == operator for vectors + //! From GLM_GTX_comparison extension. + template + bool operator== ( + detail::tvec4 const & x, + detail::tvec4 const & y); //! Define != operator for vectors //! From GLM_GTX_comparison extension. - template - bool operator!= (vecType const & x, vecType const & y); + template + bool operator!= ( + detail::tvec2 const & x, + detail::tvec2 const & y); + + //! Define != operator for vectors + //! From GLM_GTX_comparison extension. + template + bool operator!= ( + detail::tvec3 const & x, + detail::tvec3 const & y); + + //! Define != operator for vectors + //! From GLM_GTX_comparison extension. + template + bool operator!= ( + detail::tvec4 const & x, + detail::tvec4 const & y); }//namespace comparison }//namespace gtx From 2fb86e9b779982b3fb8eaf323bacc3c8fc98a1f0 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 8 Jul 2010 11:05:33 +0100 Subject: [PATCH 2/6] Added GLM_GTX_int_10_10_10_2 --- glm/gtx/int_10_10_10_2.hpp | 39 ++++++++++++++++++++++++++++++++++++++ glm/gtx/int_10_10_10_2.inl | 28 +++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 glm/gtx/int_10_10_10_2.hpp create mode 100644 glm/gtx/int_10_10_10_2.inl diff --git a/glm/gtx/int_10_10_10_2.hpp b/glm/gtx/int_10_10_10_2.hpp new file mode 100644 index 00000000..0b48f6b7 --- /dev/null +++ b/glm/gtx/int_10_10_10_2.hpp @@ -0,0 +1,39 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2010-07-07 +// Updated : 2010-07-07 +// Licence : This source is under MIT License +// File : glm/gtx/int_10_10_10_2.hpp +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Dependency: +// - GLM core +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef glm_gtx_int_10_10_10_2 +#define glm_gtx_int_10_10_10_2 + +// Dependency: +#include "../glm.hpp" + +namespace glm +{ + namespace gtx{ + //! GLM_GTX_int_10_10_10_2 extension: Add support for integer for core functions + namespace int_10_10_10_2 + { + //! From GLM_GTX_int_10_10_10_2 extension. + int int10_10_10_2_cast(glm::vec4 const & v); + + //! From GLM_GTX_int_10_10_10_2 extension. + uint uint10_10_10_2_cast(glm::vec4 const & v); + + }//namespace integer + }//namespace gtx +}//namespace glm + +#include "int_10_10_10_2.inl" + +namespace glm{using namespace gtx::int_10_10_10_2;} + +#endif//glm_gtx_int_10_10_10_2 diff --git a/glm/gtx/int_10_10_10_2.inl b/glm/gtx/int_10_10_10_2.inl new file mode 100644 index 00000000..28a87894 --- /dev/null +++ b/glm/gtx/int_10_10_10_2.inl @@ -0,0 +1,28 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2010-07-07 +// Updated : 2010-07-07 +// Licence : This source is under MIT License +// File : glm/gtx/int_10_10_10_2.inl +/////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace glm{ +namespace gtx{ +namespace int_10_10_10_2 +{ + //! From GLM_GTX_int_10_10_10_2 extension. + int int10_10_10_2_cast(glm::vec4 const & v) + { + return int(v.x * 2047.f) << 0 | int(v.y * 2047.f) << 10 | int(v.z * 2047.f) << 20 | int(v.w * 3.f) << 30; + } + + //! From GLM_GTX_int_10_10_10_2 extension. + uint uint10_10_10_2_cast(glm::vec4 const & v) + { + return uint(v.x * 2047.f) << 0 | uint(v.y * 2047.f) << 10 | uint(v.z * 2047.f) << 20 | uint(v.w * 3.f) << 30; + } + +}//namespace int_10_10_10_2 +}//namespace gtx +}//namespace glm From 52d119f7c3244cf3cd3bd7244ba3b2a642f5edce Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 8 Jul 2010 12:09:50 +0100 Subject: [PATCH 3/6] Added int 10 10 10 2 extension --- glm/ext.hpp | 1 + glm/gtx/int_10_10_10_2.hpp | 6 ++---- glm/gtx/int_10_10_10_2.inl | 11 ++--------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/glm/ext.hpp b/glm/ext.hpp index 2f054c4e..f3d29a2e 100644 --- a/glm/ext.hpp +++ b/glm/ext.hpp @@ -41,6 +41,7 @@ #include "./gtx/gradient_paint.hpp" #include "./gtx/handed_coordinate_space.hpp" #include "./gtx/inertia.hpp" +#include "./gtx/int_10_10_10_2.hpp" #include "./gtx/integer.hpp" #include "./gtx/intersect.hpp" #include "./gtx/inverse.hpp" diff --git a/glm/gtx/int_10_10_10_2.hpp b/glm/gtx/int_10_10_10_2.hpp index 0b48f6b7..966d7462 100644 --- a/glm/gtx/int_10_10_10_2.hpp +++ b/glm/gtx/int_10_10_10_2.hpp @@ -23,10 +23,8 @@ namespace glm namespace int_10_10_10_2 { //! From GLM_GTX_int_10_10_10_2 extension. - int int10_10_10_2_cast(glm::vec4 const & v); - - //! From GLM_GTX_int_10_10_10_2 extension. - uint uint10_10_10_2_cast(glm::vec4 const & v); + //! Cast a vec4 to an u_10_10_10_2. + dword uint10_10_10_2_cast(glm::vec4 const & v); }//namespace integer }//namespace gtx diff --git a/glm/gtx/int_10_10_10_2.inl b/glm/gtx/int_10_10_10_2.inl index 28a87894..8ab6a1d2 100644 --- a/glm/gtx/int_10_10_10_2.inl +++ b/glm/gtx/int_10_10_10_2.inl @@ -11,16 +11,9 @@ namespace glm{ namespace gtx{ namespace int_10_10_10_2 { - //! From GLM_GTX_int_10_10_10_2 extension. - int int10_10_10_2_cast(glm::vec4 const & v) + dword uint10_10_10_2_cast(glm::vec4 const & v) { - return int(v.x * 2047.f) << 0 | int(v.y * 2047.f) << 10 | int(v.z * 2047.f) << 20 | int(v.w * 3.f) << 30; - } - - //! From GLM_GTX_int_10_10_10_2 extension. - uint uint10_10_10_2_cast(glm::vec4 const & v) - { - return uint(v.x * 2047.f) << 0 | uint(v.y * 2047.f) << 10 | uint(v.z * 2047.f) << 20 | uint(v.w * 3.f) << 30; + return dword(uint(v.x * 2047.f) << 0 | uint(v.y * 2047.f) << 10 | uint(v.z * 2047.f) << 20 | uint(v.w * 3.f) << 30); } }//namespace int_10_10_10_2 From 7f8f26087733ef21818680a2433ad3a8bac6573e Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 8 Jul 2010 12:14:52 +0100 Subject: [PATCH 4/6] Prepare release --- doc/src/data.xml | 5 ++++- glm/setup.hpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/src/data.xml b/doc/src/data.xml index 40b8ae31..fc992026 100644 --- a/doc/src/data.xml +++ b/doc/src/data.xml @@ -3,7 +3,8 @@
- + + @@ -49,6 +50,8 @@
+ + diff --git a/glm/setup.hpp b/glm/setup.hpp index 95c639c3..9ce1b6fc 100644 --- a/glm/setup.hpp +++ b/glm/setup.hpp @@ -17,7 +17,7 @@ #define GLM_VERSION_MAJOR 0 #define GLM_VERSION_MINOR 9 #define GLM_VERSION_PATCH 0 -#define GLM_VERSION_REVISION 0 +#define GLM_VERSION_REVISION 2 /////////////////////////////////////////////////////////////////////////////////////////////////// // Common values From 3df06bee417bbd0866c2a058756b09f70d12e128 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 8 Jul 2010 12:24:33 +0100 Subject: [PATCH 5/6] Fixed extension dependence --- glm/gtx/int_10_10_10_2.hpp | 3 +++ readme.txt | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/glm/gtx/int_10_10_10_2.hpp b/glm/gtx/int_10_10_10_2.hpp index 966d7462..2108d935 100644 --- a/glm/gtx/int_10_10_10_2.hpp +++ b/glm/gtx/int_10_10_10_2.hpp @@ -15,6 +15,7 @@ // Dependency: #include "../glm.hpp" +#include "../gtx/raw_data.hpp" namespace glm { @@ -22,6 +23,8 @@ namespace glm //! GLM_GTX_int_10_10_10_2 extension: Add support for integer for core functions namespace int_10_10_10_2 { + using namespace gtx::raw_data; + //! From GLM_GTX_int_10_10_10_2 extension. //! Cast a vec4 to an u_10_10_10_2. dword uint10_10_10_2_cast(glm::vec4 const & v); diff --git a/readme.txt b/readme.txt index 4003fb7d..b2739796 100644 --- a/readme.txt +++ b/readme.txt @@ -4,6 +4,12 @@ G-Truc Creation www.g-truc.net glm@g-truc.net +============================= +GLM 0.9.0.2: 2010-07-08 +----------------------------- +- Added GLM_GTX_int_10_10_10_2 +- Fixed bugs + ============================= GLM 0.9.0.1: 2010-06-21 ----------------------------- From 1a891b9efbd6c78118210bc2f708dbbafe3450bb Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 8 Jul 2010 12:35:40 +0100 Subject: [PATCH 6/6] Updated doc --- doc/src/data.xml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/src/data.xml b/doc/src/data.xml index aec104bd..a6d432b2 100644 --- a/doc/src/data.xml +++ b/doc/src/data.xml @@ -3,7 +3,7 @@
- + @@ -50,7 +50,7 @@
- + @@ -1528,11 +1528,13 @@ - Second update of GLM 0.9.0 with more bug fixes + Second update of GLM 0.9.0 with more bug fixes. + It also contains a new extension called GLM_GTX_int_10_10_10_2 to use GLM with OpenGL and + GL_ARB_vertex_type_2_10_10_10_rev. - GLM 0.9.0.2 (zip, 714 KB) - GLM 0.9.0.2 (7z, 556 KB) + GLM 0.9.0.2 (zip, 809 KB) + GLM 0.9.0.2 (7z, 651 KB) Submit a bug report