29 #ifndef glm_core_type_gentype2
30 #define glm_core_type_gentype2
41 template <
typename T>
struct tref2;
42 template <
typename T>
struct tref3;
43 template <
typename T>
struct tref4;
44 template <
typename T>
struct tvec3;
45 template <
typename T>
struct tvec4;
53 typedef std::size_t size_type;
54 typedef tvec2<T> type;
55 typedef tvec2<bool> bool_type;
57 GLM_FUNC_DECL GLM_CONSTEXPR size_type
length()
const;
62 # if(GLM_COMPONENT == GLM_COMPONENT_CXX11)
65 # if(defined(GLM_SWIZZLE))
66 _GLM_SWIZZLE2_2_MEMBERS(value_type, glm::detail::tvec2<value_type>, x, y)
67 _GLM_SWIZZLE2_2_MEMBERS(value_type, glm::detail::tvec2<value_type>, r, g)
68 _GLM_SWIZZLE2_2_MEMBERS(value_type, glm::detail::tvec2<value_type>, s, t)
69 _GLM_SWIZZLE2_3_MEMBERS(value_type, glm::detail::tvec3<value_type>, x, y)
70 _GLM_SWIZZLE2_3_MEMBERS(value_type, glm::detail::tvec3<value_type>, r, g)
71 _GLM_SWIZZLE2_3_MEMBERS(value_type, glm::detail::tvec3<value_type>, s, t)
72 _GLM_SWIZZLE2_4_MEMBERS(value_type, glm::detail::tvec4<value_type>, x, y)
73 _GLM_SWIZZLE2_4_MEMBERS(value_type, glm::detail::tvec4<value_type>, r, g)
74 _GLM_SWIZZLE2_4_MEMBERS(value_type, glm::detail::tvec4<value_type>, s, t)
75 # endif//(defined(GLM_SWIZZLE))
77 struct{value_type r, g;};
78 struct{value_type s, t;};
79 struct{value_type x, y;};
81 # elif(GLM_COMPONENT == GLM_COMPONENT_CXX98)
82 union {value_type x, r, s;};
83 union {value_type y, g, t;};
85 # if(defined(GLM_SWIZZLE))
87 GLM_SWIZZLE_GEN_REF_FROM_VEC2(value_type, detail::tvec2, detail::tref2)
88 GLM_SWIZZLE_GEN_VEC_FROM_VEC2(value_type, detail::tvec2, detail::tvec2, detail::tvec3, detail::tvec4)
89 # endif//(defined(GLM_SWIZZLE))
90 # else //(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW)
93 # if(defined(GLM_SWIZZLE))
95 GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(value_type, detail::tvec2, detail::tref2, x, y)
96 GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(value_type, detail::tvec2, detail::tvec2, detail::tvec3, detail::tvec4, x, y)
97 # endif//(defined(GLM_SWIZZLE))
98 # endif//GLM_COMPONENT
103 GLM_FUNC_DECL value_type & operator[](size_type i);
104 GLM_FUNC_DECL value_type
const & operator[](size_type i)
const;
109 GLM_FUNC_DECL tvec2();
110 GLM_FUNC_DECL tvec2(tvec2<T>
const & v);
115 GLM_FUNC_DECL
explicit tvec2(
117 GLM_FUNC_DECL
explicit tvec2(
118 value_type
const & s);
119 GLM_FUNC_DECL
explicit tvec2(
120 value_type
const & s1,
121 value_type
const & s2);
126 tvec2(tref2<T>
const & r);
128 template <
int E0,
int E1>
129 GLM_FUNC_DECL tvec2(
const glm::detail::swizzle<2,T,tvec2<T>,E0,E1,-1,-2>& that)
138 template <
typename U>
139 GLM_FUNC_DECL
explicit tvec2(
142 template <
typename U,
typename V>
143 GLM_FUNC_DECL
explicit tvec2(
151 template <
typename U>
152 GLM_FUNC_DECL
explicit tvec2(tvec2<U>
const & v);
154 template <
typename U>
155 GLM_FUNC_DECL
explicit tvec2(tvec3<U>
const & v);
157 template <
typename U>
158 GLM_FUNC_DECL
explicit tvec2(tvec4<U>
const & v);
163 GLM_FUNC_DECL tvec2<T> & operator= (tvec2<T>
const & v);
164 template <
typename U>
165 GLM_FUNC_DECL tvec2<T> & operator= (tvec2<U>
const & v);
167 template <
typename U>
168 GLM_FUNC_DECL tvec2<T> & operator+=(U
const & s);
169 template <
typename U>
170 GLM_FUNC_DECL tvec2<T> & operator+=(tvec2<U>
const & v);
171 template <
typename U>
172 GLM_FUNC_DECL tvec2<T> & operator-=(U
const & s);
173 template <
typename U>
174 GLM_FUNC_DECL tvec2<T> & operator-=(tvec2<U>
const & v);
175 template <
typename U>
176 GLM_FUNC_DECL tvec2<T> & operator*=(U
const & s);
177 template <
typename U>
178 GLM_FUNC_DECL tvec2<T> & operator*=(tvec2<U>
const & v);
179 template <
typename U>
180 GLM_FUNC_DECL tvec2<T> & operator/=(U
const & s);
181 template <
typename U>
182 GLM_FUNC_DECL tvec2<T> & operator/=(tvec2<U>
const & v);
183 GLM_FUNC_DECL tvec2<T> & operator++();
184 GLM_FUNC_DECL tvec2<T> & operator--();
189 template <
typename U>
190 GLM_FUNC_DECL tvec2<T> & operator%= (U
const & s);
191 template <
typename U>
192 GLM_FUNC_DECL tvec2<T> & operator%= (tvec2<U>
const & v);
193 template <
typename U>
194 GLM_FUNC_DECL tvec2<T> & operator&= (U
const & s);
195 template <
typename U>
196 GLM_FUNC_DECL tvec2<T> & operator&= (tvec2<U>
const & v);
197 template <
typename U>
198 GLM_FUNC_DECL tvec2<T> & operator|= (U
const & s);
199 template <
typename U>
200 GLM_FUNC_DECL tvec2<T> & operator|= (tvec2<U>
const & v);
201 template <
typename U>
202 GLM_FUNC_DECL tvec2<T> & operator^= (U
const & s);
203 template <
typename U>
204 GLM_FUNC_DECL tvec2<T> & operator^= (tvec2<U>
const & v);
205 template <
typename U>
206 GLM_FUNC_DECL tvec2<T> & operator<<=(U
const & s);
207 template <
typename U>
208 GLM_FUNC_DECL tvec2<T> & operator<<=(tvec2<U>
const & v);
209 template <
typename U>
210 GLM_FUNC_DECL tvec2<T> & operator>>=(U
const & s);
211 template <
typename U>
212 GLM_FUNC_DECL tvec2<T> & operator>>=(tvec2<U>
const & v);
217 GLM_FUNC_DECL value_type swizzle(comp X)
const;
218 GLM_FUNC_DECL tvec2<T> swizzle(comp X, comp Y)
const;
219 GLM_FUNC_DECL tvec3<T> swizzle(comp X, comp Y, comp Z)
const;
220 GLM_FUNC_DECL tvec4<T> swizzle(comp X, comp Y, comp Z, comp W)
const;
221 GLM_FUNC_DECL tref2<T> swizzle(comp X, comp Y);
224 template <
typename T>
227 GLM_FUNC_DECL tref2(T & x, T & y);
228 GLM_FUNC_DECL tref2(tref2<T>
const & r);
229 GLM_FUNC_DECL
explicit tref2(tvec2<T>
const & v);
231 GLM_FUNC_DECL tref2<T> & operator= (tref2<T>
const & r);
232 GLM_FUNC_DECL tref2<T> & operator= (tvec2<T>
const & v);
234 GLM_FUNC_DECL tvec2<T> operator() ();
240 GLM_DETAIL_IS_VECTOR(tvec2);
313 #ifndef GLM_EXTERNAL_TEMPLATE
314 #include "type_vec2.inl"
315 #endif//GLM_EXTERNAL_TEMPLATE
317 #endif//glm_core_type_gentype2