1
///////////////////////////////////////////////////////////////////////////////////
2
/// OpenGL Mathematics (glm.g-truc.net)
4
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
5
/// Permission is hereby granted, free of charge, to any person obtaining a copy
6
/// of this software and associated documentation files (the "Software"), to deal
7
/// in the Software without restriction, including without limitation the rights
8
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
/// copies of the Software, and to permit persons to whom the Software is
10
/// furnished to do so, subject to the following conditions:
12
/// The above copyright notice and this permission notice shall be included in
13
/// all copies or substantial portions of the Software.
15
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
/// @file glm/core/type_gentype.hpp
25
/// @date 2008-10-05 / 2011-06-15
26
/// @author Christophe Riccio
27
///////////////////////////////////////////////////////////////////////////////////
29
#ifndef glm_core_type_gentype
30
#define glm_core_type_gentype
32
#include "type_size.hpp"
48
template <typename> class TYPE
55
typedef VALTYPE value_type;
56
typedef VALTYPE & value_reference;
57
typedef VALTYPE * value_pointer;
58
typedef VALTYPE const * value_const_pointer;
59
typedef TYPE<bool> bool_type;
61
typedef sizeType size_type;
62
static bool is_vector();
63
static bool is_matrix();
65
typedef TYPE<VALTYPE> type;
66
typedef TYPE<VALTYPE> * pointer;
67
typedef TYPE<VALTYPE> const * const_pointer;
68
typedef TYPE<VALTYPE> const * const const_pointer_const;
69
typedef TYPE<VALTYPE> * const pointer_const;
70
typedef TYPE<VALTYPE> & reference;
71
typedef TYPE<VALTYPE> const & const_reference;
72
typedef TYPE<VALTYPE> const & param_type;
74
//////////////////////////////////////
75
// Address (Implementation details)
77
value_const_pointer value_address() const{return value_pointer(this);}
78
value_pointer value_address(){return value_pointer(this);}
88
// typedef typename TYPE::kind kind;
94
template <typename> class TYPE
96
bool genType<VALTYPE, TYPE>::is_vector()
101
template <typename valTypeT, unsigned int colT, unsigned int rowT, profile proT = nice>
105
//////////////////////////////////////
108
typedef sizeType size_type;
109
typedef valTypeT value_type;
111
typedef base<value_type, colT, rowT> class_type;
113
typedef base<bool, colT, rowT> bool_type;
114
typedef base<value_type, rowT, 1> col_type;
115
typedef base<value_type, colT, 1> row_type;
116
typedef base<value_type, rowT, colT> transpose_type;
118
static size_type col_size();
119
static size_type row_size();
120
static size_type value_size();
121
static bool is_scalar();
122
static bool is_vector();
123
static bool is_matrix();
127
col_type value[colT];
130
//////////////////////////////////////
133
base(class_type const & m);
135
explicit base(value_type const & x);
136
explicit base(value_type const * const x);
137
explicit base(col_type const * const x);
139
//////////////////////////////////////
141
template <typename vU, uint cU, uint rU, profile pU>
142
explicit base(base<vU, cU, rU, pU> const & m);
144
//////////////////////////////////////
146
col_type& operator[](size_type i);
147
col_type const & operator[](size_type i) const;
149
//////////////////////////////////////
150
// Unary updatable operators
151
class_type& operator= (class_type const & x);
152
class_type& operator+= (value_type const & x);
153
class_type& operator+= (class_type const & x);
154
class_type& operator-= (value_type const & x);
155
class_type& operator-= (class_type const & x);
156
class_type& operator*= (value_type const & x);
157
class_type& operator*= (class_type const & x);
158
class_type& operator/= (value_type const & x);
159
class_type& operator/= (class_type const & x);
160
class_type& operator++ ();
161
class_type& operator-- ();
167
//#include "type_gentype.inl"
169
#endif//glm_core_type_gentype