range.hpp
Go to the documentation of this file.
#pragma once
// Dependencies
#include "../detail/setup.hpp"
#if !GLM_HAS_RANGE_FOR
# error "GLM_GTX_range requires C++11 suppport or 'range for'"
#endif
#include "../gtc/type_ptr.hpp"
namespace glm{
namespace detail
{
/* The glm types provide a .length() member, but for matrices
this only defines the number of columns, so we need to work around this */
template <typename T, precision P>
detail::component_count_t number_of_elements_(tvec2<T, P> const & v){
return detail::component_count(v);
}
template <typename T, precision P>
detail::component_count_t number_of_elements_(tvec3<T, P> const & v){
return detail::component_count(v);
}
template <typename T, precision P>
detail::component_count_t number_of_elements_(tvec4<T, P> const & v){
return detail::component_count(v);
}
template <typename genType>
detail::component_count_t number_of_elements_(genType const & m){
return detail::component_count(m) * detail::component_count(m[0]);
}
}//namespace
template <typename genType>
const typename genType::value_type * begin(genType const & v){
return value_ptr(v);
}
template <typename genType>
const typename genType::value_type * end(genType const & v){
return begin(v) + detail::number_of_elements_(v);
}
template <typename genType>
typename genType::value_type * begin(genType& v){
return value_ptr(v);
}
template <typename genType>
typename genType::value_type * end(genType& v){
return begin(v) + detail::number_of_elements_(v);
}
}//namespace glm
glm::value_ptr
GLM_FUNC_DECL genType::value_type const * value_ptr(genType const &vec)
Return the constant address to the data of the input parameter.
glm
Definition: _noise.hpp:39