diff --git a/glm/detail/type_gentype.hpp b/glm/detail/type_gentype.hpp deleted file mode 100644 index b45cdf47..00000000 --- a/glm/detail/type_gentype.hpp +++ /dev/null @@ -1,195 +0,0 @@ -/// @ref core -/// @file glm/detail/type_gentype.hpp - -#pragma once - -namespace glm -{ - enum profile - { - nice, - fast, - simd - }; - - typedef std::size_t sizeType; - -namespace detail -{ - template - < - typename VALTYPE, - template class TYPE - > - struct genType - { - public: - enum ctor{null}; - - typedef VALTYPE value_type; - typedef VALTYPE & value_reference; - typedef VALTYPE * value_pointer; - typedef VALTYPE const * value_const_pointer; - typedef TYPE bool_type; - - typedef sizeType size_type; - static bool is_vector(); - static bool is_matrix(); - - typedef TYPE type; - typedef TYPE * pointer; - typedef TYPE const * const_pointer; - typedef TYPE const * const const_pointer_const; - typedef TYPE * const pointer_const; - typedef TYPE & reference; - typedef TYPE const& const_reference; - typedef TYPE const& param_type; - - ////////////////////////////////////// - // Address (Implementation details) - - value_const_pointer value_address() const{return value_pointer(this);} - value_pointer value_address(){return value_pointer(this);} - - //protected: - // enum kind - // { - // GEN_TYPE, - // VEC_TYPE, - // MAT_TYPE - // }; - - // typedef typename TYPE::kind kind; - }; - - template - < - typename VALTYPE, - template class TYPE - > - bool genType::is_vector() - { - return true; - } -/* - template - class base - { - public: - ////////////////////////////////////// - // Traits - - typedef sizeType size_type; - typedef valTypeT value_type; - - typedef base class_type; - - typedef base bool_type; - typedef base col_type; - typedef base row_type; - typedef base transpose_type; - - static size_type col_size(); - static size_type row_size(); - static size_type value_size(); - static bool is_scalar(); - static bool is_vector(); - static bool is_matrix(); - - private: - // Data - col_type value[colT]; - - public: - ////////////////////////////////////// - // Constructors - base(); - base(class_type const& m); - - explicit base(T const& x); - explicit base(value_type const * const x); - explicit base(col_type const * const x); - - ////////////////////////////////////// - // Conversions - template - explicit base(base const& m); - - ////////////////////////////////////// - // Accesses - col_type& operator[](size_type i); - col_type const& operator[](size_type i) const; - - ////////////////////////////////////// - // Unary updatable operators - class_type& operator= (class_type const& x); - class_type& operator+= (T const& x); - class_type& operator+= (class_type const& x); - class_type& operator-= (T const& x); - class_type& operator-= (class_type const& x); - class_type& operator*= (T const& x); - class_type& operator*= (class_type const& x); - class_type& operator/= (T const& x); - class_type& operator/= (class_type const& x); - class_type& operator++ (); - class_type& operator-- (); - }; -*/ - - //template - //struct traits - //{ - // static const bool is_signed = false; - // static const bool is_float = false; - // static const bool is_vector = false; - // static const bool is_matrix = false; - // static const bool is_genType = false; - // static const bool is_genIType = false; - // static const bool is_genUType = false; - //}; - - //template<> - //struct traits - //{ - // static const bool is_float = true; - // static const bool is_genType = true; - //}; - - //template<> - //struct traits - //{ - // static const bool is_float = true; - // static const bool is_genType = true; - //}; - - //template<> - //struct traits - //{ - // static const bool is_float = true; - // static const bool is_genType = true; - //}; - - //template - //struct desc - //{ - // typedef genType type; - // typedef genType * pointer; - // typedef genType const* const_pointer; - // typedef genType const *const const_pointer_const; - // typedef genType *const pointer_const; - // typedef genType & reference; - // typedef genType const& const_reference; - // typedef genType const& param_type; - - // typedef typename genType::value_type value_type; - // typedef typename genType::size_type size_type; - // static const typename size_type value_size; - //}; - - //template - //const typename desc::size_type desc::value_size = genType::value_size(); - -}//namespace detail -}//namespace glm - -//#include "type_gentype.inl" diff --git a/glm/detail/type_gentype.inl b/glm/detail/type_gentype.inl deleted file mode 100644 index 60ffa9a9..00000000 --- a/glm/detail/type_gentype.inl +++ /dev/null @@ -1,341 +0,0 @@ -/// @ref core -/// @file glm/detail/type_gentype.inl - -namespace glm{ -namespace detail{ - -///////////////////////////////// -// Static functions - -template -typename base::size_type base::col_size() -{ - return cT; -} - -template -typename base::size_type base::row_size() -{ - return rT; -} - -template -typename base::size_type base::value_size() -{ - return rT * cT; -} - -template -bool base::is_scalar() -{ - return rT == 1 && cT == 1; -} - -template -bool base::is_vector() -{ - return rT == 1; -} - -template -bool base::is_matrix() -{ - return rT != 1; -} - -///////////////////////////////// -// Constructor - -template -base::base() -{ - memset(&this->value, 0, cT * rT * sizeof(vT)); -} - -template -base::base -( - typename base::class_type const& m -) -{ - for - ( - typename genType::size_type i = typename base::size_type(0); - i < base::col_size(); - ++i - ) - { - this->value[i] = m[i]; - } -} - -template -base::base -( - typename base::T const& x -) -{ - if(rT == 1) // vector - { - for - ( - typename base::size_type i = typename base::size_type(0); - i < base::col_size(); - ++i - ) - { - this->value[i][rT] = x; - } - } - else // matrix - { - memset(&this->value, 0, cT * rT * sizeof(vT)); - - typename base::size_type stop = cT < rT ? cT : rT; - - for - ( - typename base::size_type i = typename base::size_type(0); - i < stop; - ++i - ) - { - this->value[i][i] = x; - } - } -} - -template -base::base -( - typename base::value_type const * const x -) -{ - memcpy(&this->value, &x.value, cT * rT * sizeof(vT)); -} - -template -base::base -( - typename base::col_type const * const x -) -{ - for - ( - typename base::size_type i = typename base::size_type(0); - i < base::col_size(); - ++i - ) - { - this->value[i] = x[i]; - } -} - -template -template -base::base -( - base const& m -) -{ - for - ( - typename base::size_type i = typename base::size_type(0); - i < base::col_size(); - ++i - ) - { - this->value[i] = base(m[i]); - } -} - -////////////////////////////////////// -// Accesses - -template -typename base::col_type& base::operator[] -( - typename base::size_type i -) -{ - return this->value[i]; -} - -template -typename base::col_type const& base::operator[] -( - typename base::size_type i -) const -{ - return this->value[i]; -} - -////////////////////////////////////// -// Unary updatable operators - -template -typename base::class_type& base::operator= -( - typename base::class_type const& x -) -{ - memcpy(&this->value, &x.value, cT * rT * sizeof(vT)); - return *this; -} - -template -typename base::class_type& base::operator+= -( - typename base::T const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] += x; - - return *this; -} - -template -typename base::class_type& base::operator+= -( - typename base::class_type const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] += x[j][i]; - - return *this; -} - -template -typename base::class_type& base::operator-= -( - typename base::T const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] -= x; - - return *this; -} - -template -typename base::class_type& base::operator-= -( - typename base::class_type const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] -= x[j][i]; - - return *this; -} - -template -typename base::class_type& base::operator*= -( - typename base::T const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] *= x; - - return *this; -} - -template -typename base::class_type& base::operator*= -( - typename base::class_type const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] *= x[j][i]; - - return *this; -} - -template -typename base::class_type& base::operator/= -( - typename base::T const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] /= x; - - return *this; -} - -template -typename base::class_type& base::operator/= -( - typename base::class_type const& x -) -{ - typename base::size_type stop_col = x.col_size(); - typename base::size_type stop_row = x.row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - this->value[j][i] /= x[j][i]; - - return *this; -} - -template -typename base::class_type& base::operator++ () -{ - typename base::size_type stop_col = col_size(); - typename base::size_type stop_row = row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - ++this->value[j][i]; - - return *this; -} - -template -typename base::class_type& base::operator-- () -{ - typename base::size_type stop_col = col_size(); - typename base::size_type stop_row = row_size(); - - for(typename base::size_type j = 0; j < stop_col; ++j) - for(typename base::size_type i = 0; i < stop_row; ++i) - --this->value[j][i]; - - return *this; -} - -} //namespace detail -} //namespace glm