diff --git a/glm/detail/func_vector_relational.hpp b/glm/detail/func_vector_relational.hpp index 075de262..3786caea 100644 --- a/glm/detail/func_vector_relational.hpp +++ b/glm/detail/func_vector_relational.hpp @@ -132,6 +132,20 @@ namespace glm template class vecType> GLM_FUNC_DECL vecType not_(vecType const & v); +# if GLM_COMPILER & GLM_COMPILER_VC && GLM_COMPILER >= GLM_COMPILER_VC12 + + /// Returns the component-wise logical complement of x. + /// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead. + /// + /// @tparam vecType Boolean vector types. + /// + /// @see GLSL not man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template class vecType> + GLM_FUNC_DECL vecType not(vecType const & v){return not_(v);} + +# endif + /// @} }//namespace glm diff --git a/glm/detail/func_vector_relational.inl b/glm/detail/func_vector_relational.inl index 0c136928..9c83de5e 100644 --- a/glm/detail/func_vector_relational.inl +++ b/glm/detail/func_vector_relational.inl @@ -33,8 +33,6 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType lessThan(vecType const & x, vecType const & y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, - "Invalid template instantiation of 'lessThan', GLM vector types required floating-point or integer value types vectors"); assert(detail::component_count(x) == detail::component_count(y)); vecType Result(uninitialize); @@ -47,8 +45,6 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType lessThanEqual(vecType const & x, vecType const & y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, - "Invalid template instantiation of 'lessThanEqual', GLM vector types required floating-point or integer value types vectors"); assert(detail::component_count(x) == detail::component_count(y)); vecType Result(uninitialize); @@ -60,8 +56,6 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType greaterThan(vecType const & x, vecType const & y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, - "Invalid template instantiation of 'greaterThan', GLM vector types required floating-point or integer value types vectors"); assert(detail::component_count(x) == detail::component_count(y)); vecType Result(uninitialize); @@ -73,8 +67,6 @@ namespace glm template class vecType> GLM_FUNC_QUALIFIER vecType greaterThanEqual(vecType const & x, vecType const & y) { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, - "Invalid template instantiation of 'greaterThanEqual', GLM vector types required floating-point or integer value types vectors"); assert(detail::component_count(x) == detail::component_count(y)); vecType Result(uninitialize); diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 058ae193..1b12d911 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -391,7 +391,7 @@ # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG) # endif # else -# if(GLM_COMPILER >= GLM_COMPILER_VC10 +# if GLM_COMPILER >= GLM_COMPILER_VC10 # define GLM_LANG GLM_LANG_CXX0X # else # define GLM_LANG GLM_LANG_CXX98 diff --git a/readme.txt b/readme.txt index 6bf0b337..12c32039 100644 --- a/readme.txt +++ b/readme.txt @@ -75,6 +75,7 @@ GLM 0.9.6.0: 2014-XX-XX - Separated Apple Clang and LLVM compiler detection - Added GLM_FORCE_NO_CTOR_INIT - Added 'uninitialize' to explicitly not initialize a GLM type +- Added not function (from GLSL specification) on VC12 ================================================================================ GLM 0.9.5.4: 2014-06-21 diff --git a/test/core/core_func_vector_relational.cpp b/test/core/core_func_vector_relational.cpp index e078241f..58978c6d 100644 --- a/test/core/core_func_vector_relational.cpp +++ b/test/core/core_func_vector_relational.cpp @@ -7,12 +7,45 @@ // File : test/core/vector_relational.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// -#include +#include +#include +#include +#include +#include + +int test_not() +{ + int Error(0); + + { + glm::bvec1 v(false); + Error += glm::all(glm::not_(v)) ? 0 : 1; + } + + { + glm::bvec2 v(false); + Error += glm::all(glm::not_(v)) ? 0 : 1; + } + + { + glm::bvec3 v(false); + Error += glm::all(glm::not_(v)) ? 0 : 1; + } + + { + glm::bvec4 v(false); + Error += glm::all(glm::not_(v)) ? 0 : 1; + } + + return Error; +} int main() { int Error(0); + Error += test_not(); + return Error; }