mirror of
https://github.com/g-truc/glm.git
synced 2025-04-08 06:43:10 +00:00
Simplify the constexpr declarations of the GLM_META_PROG_HELPERS
- No repetition - Half the size
This commit is contained in:
parent
6d1ddc8980
commit
c2078afc12
18 changed files with 59 additions and 167 deletions
|
@ -55,17 +55,10 @@ namespace glm
|
|||
friend tvec2<U, Q> operator/(tvec2<U, Q> const & v, tmat2x2<U, Q> const & m);
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 2;
|
||||
static GLM_CONSTEXPR length_t columns = 2;
|
||||
static GLM_CONSTEXPR length_t rows = 2;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 2;
|
||||
static const length_t columns = 2;
|
||||
static const length_t rows = 2;
|
||||
static const precision prec = P;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 2;
|
||||
static GLM_CONSTEXPR_MAYBE length_t columns = 2;
|
||||
static GLM_CONSTEXPR_MAYBE length_t rows = 2;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
private:
|
||||
|
|
|
@ -51,17 +51,10 @@ namespace glm
|
|||
typedef T value_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 2;
|
||||
static GLM_CONSTEXPR length_t cols = 3;
|
||||
static GLM_CONSTEXPR length_t rows = 2;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 2;
|
||||
static const length_t cols = 3;
|
||||
static const length_t rows = 2;
|
||||
static const precision prec = P;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 2;
|
||||
static GLM_CONSTEXPR_MAYBE length_t cols = 3;
|
||||
static GLM_CONSTEXPR_MAYBE length_t rows = 2;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
private:
|
||||
|
|
|
@ -51,17 +51,10 @@ namespace glm
|
|||
typedef T value_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 2;
|
||||
static GLM_CONSTEXPR length_t cols = 4;
|
||||
static GLM_CONSTEXPR length_t rows = 2;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 2;
|
||||
static const length_t cols = 4;
|
||||
static const length_t rows = 2;
|
||||
static const precision prec = P;
|
||||
# endif
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 2;
|
||||
static GLM_CONSTEXPR_MAYBE length_t cols = 4;
|
||||
static GLM_CONSTEXPR_MAYBE length_t rows = 2;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
private:
|
||||
|
|
|
@ -51,17 +51,10 @@ namespace glm
|
|||
typedef T value_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 3;
|
||||
static GLM_CONSTEXPR length_t cols = 2;
|
||||
static GLM_CONSTEXPR length_t rows = 3;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 3;
|
||||
static const length_t cols = 2;
|
||||
static const length_t rows = 3;
|
||||
static const precision prec = P;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 3;
|
||||
static GLM_CONSTEXPR_MAYBE length_t cols = 2;
|
||||
static GLM_CONSTEXPR_MAYBE length_t rows = 3;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
private:
|
||||
|
|
|
@ -49,17 +49,12 @@ namespace glm
|
|||
typedef tmat3x3<T, P> transpose_type;
|
||||
typedef T value_type;
|
||||
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 3;
|
||||
static GLM_CONSTEXPR length_t cols = 3;
|
||||
static GLM_CONSTEXPR length_t rows = 3;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 3;
|
||||
static const length_t cols = 3;
|
||||
static const length_t rows = 3;
|
||||
static const precision prec = P;
|
||||
# endif
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 3;
|
||||
static GLM_CONSTEXPR_MAYBE length_t cols = 3;
|
||||
static GLM_CONSTEXPR_MAYBE length_t rows = 3;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
template <typename U, precision Q>
|
||||
friend tvec3<U, Q> operator/(tmat3x3<U, Q> const & m, tvec3<U, Q> const & v);
|
||||
|
|
|
@ -51,17 +51,10 @@ namespace glm
|
|||
typedef T value_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 3;
|
||||
static GLM_CONSTEXPR length_t cols = 4;
|
||||
static GLM_CONSTEXPR length_t rows = 3;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 3;
|
||||
static const length_t cols = 4;
|
||||
static const length_t rows = 3;
|
||||
static const precision prec = P;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 3;
|
||||
static GLM_CONSTEXPR_MAYBE length_t cols = 4;
|
||||
static GLM_CONSTEXPR_MAYBE length_t rows = 3;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
private:
|
||||
|
|
|
@ -51,17 +51,10 @@ namespace glm
|
|||
typedef T value_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 4;
|
||||
static GLM_CONSTEXPR length_t cols = 2;
|
||||
static GLM_CONSTEXPR length_t rows = 4;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 4;
|
||||
static const length_t cols = 2;
|
||||
static const length_t rows = 4;
|
||||
static const precision prec = P;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 4;
|
||||
static GLM_CONSTEXPR_MAYBE length_t cols = 2;
|
||||
static GLM_CONSTEXPR_MAYBE length_t rows = 4;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
private:
|
||||
|
|
|
@ -51,17 +51,10 @@ namespace glm
|
|||
typedef T value_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 4;
|
||||
static GLM_CONSTEXPR length_t cols = 3;
|
||||
static GLM_CONSTEXPR length_t rows = 4;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 4;
|
||||
static const length_t cols = 3;
|
||||
static const length_t rows = 4;
|
||||
static const precision prec = P;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 4;
|
||||
static GLM_CONSTEXPR_MAYBE length_t cols = 3;
|
||||
static GLM_CONSTEXPR_MAYBE length_t rows = 4;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
private:
|
||||
|
|
|
@ -50,17 +50,10 @@ namespace glm
|
|||
typedef T value_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 4;
|
||||
static GLM_CONSTEXPR length_t cols = 4;
|
||||
static GLM_CONSTEXPR length_t rows = 4;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 4;
|
||||
static const length_t cols = 4;
|
||||
static const length_t rows = 4;
|
||||
static const precision prec = P;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 4;
|
||||
static GLM_CONSTEXPR_MAYBE length_t cols = 4;
|
||||
static GLM_CONSTEXPR_MAYBE length_t rows = 4;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
template <typename U, precision Q>
|
||||
|
|
|
@ -56,13 +56,8 @@ namespace glm
|
|||
typedef T value_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 1;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 1;
|
||||
static const precision prec = P;
|
||||
# endif
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 1;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
//////////////////////////////////////
|
||||
|
|
|
@ -56,13 +56,8 @@ namespace glm
|
|||
typedef T value_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 2;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 2;
|
||||
static const precision prec = P;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 2;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
//////////////////////////////////////
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace glm
|
|||
{
|
||||
template <typename T, precision P = defaultp>
|
||||
struct tvec3
|
||||
{
|
||||
{
|
||||
//////////////////////////////////////
|
||||
// Implementation detail
|
||||
|
||||
|
@ -56,13 +56,8 @@ namespace glm
|
|||
typedef T value_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 3;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 3;
|
||||
static const precision prec = P;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 3;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
//////////////////////////////////////
|
||||
|
|
|
@ -110,13 +110,8 @@ namespace detail
|
|||
typedef T value_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 4;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 4;
|
||||
static const precision prec = P;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 4;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
//////////////////////////////////////
|
||||
|
|
|
@ -66,13 +66,8 @@ namespace glm
|
|||
typedef T value_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 4;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 4;
|
||||
static const precision prec = P;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 4;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
public:
|
||||
|
|
|
@ -65,13 +65,8 @@ namespace glm
|
|||
typedef glm::tquat<T, P> part_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 8;
|
||||
static GLM_CONSTEXPR precision prec = P;
|
||||
# else
|
||||
static const length_t components = 8;
|
||||
static const precision prec = P;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 8;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
public:
|
||||
|
|
|
@ -72,17 +72,10 @@ namespace detail
|
|||
typedef fmat4x4SIMD transpose_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 4;
|
||||
static GLM_CONSTEXPR length_t cols = 4;
|
||||
static GLM_CONSTEXPR length_t rows = 4;
|
||||
static GLM_CONSTEXPR precision prec = defaultp;
|
||||
# else
|
||||
static const length_t components = 4;
|
||||
static const length_t cols = 4;
|
||||
static const length_t rows = 4;
|
||||
static const precision prec = defaultp;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 4;
|
||||
static GLM_CONSTEXPR_MAYBE length_t cols = 4;
|
||||
static GLM_CONSTEXPR_MAYBE length_t rows = 4;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = defaultp;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
GLM_FUNC_DECL length_t length() const;
|
||||
|
|
|
@ -77,13 +77,8 @@ namespace detail
|
|||
typedef tquat<bool, defaultp> bool_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 4;
|
||||
static GLM_CONSTEXPR precision prec = defaultp;
|
||||
# else
|
||||
static const length_t components = 4;
|
||||
static const precision prec = defaultp;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 4;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = defaultp;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
#ifdef GLM_SIMD_ENABLE_XYZW_UNION
|
||||
|
|
|
@ -100,13 +100,8 @@ namespace detail
|
|||
typedef tvec4<bool, highp> bool_type;
|
||||
|
||||
# ifdef GLM_META_PROG_HELPERS
|
||||
# if GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR length_t components = 4;
|
||||
static GLM_CONSTEXPR precision prec = defaultp;
|
||||
# else
|
||||
static const length_t components = 4;
|
||||
static const precision prec = defaultp;
|
||||
# endif//GLM_HAS_CONSTEXPR
|
||||
static GLM_CONSTEXPR_MAYBE length_t components = 4;
|
||||
static GLM_CONSTEXPR_MAYBE precision prec = defaultp;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
#ifdef GLM_SIMD_ENABLE_XYZW_UNION
|
||||
|
|
Loading…
Add table
Reference in a new issue