Wrap tvec2's static constants in GLM_STATIC_CONST_MEMBERS

This commit is contained in:
Jesse Talavera-Greenberg 2015-10-05 18:23:18 -04:00
parent 5a60b3986b
commit 4552ec737e
3 changed files with 7 additions and 0 deletions

View File

@ -58,10 +58,13 @@ namespace glm
static GLM_RELAXED_CONSTEXPR precision prec = P;
# endif//GLM_META_PROG_HELPERS
# ifdef GLM_STATIC_CONST_MEMBERS
static const type ZERO;
static const type X;
static const type Y;
static const type XY;
# endif
// -- Data --
# if GLM_HAS_ANONYMOUS_UNION

View File

@ -28,6 +28,7 @@
namespace glm
{
# ifdef GLM_STATIC_CONST_MEMBERS
template <typename T, precision P>
const tvec2<T, P> tvec2<T, P>::ZERO = tvec2<T, P>(static_cast<T>(0), static_cast<T>(0));
@ -39,6 +40,7 @@ namespace glm
template <typename T, precision P>
const tvec2<T, P> tvec2<T, P>::XY = tvec2<T, P>(static_cast<T>(1), static_cast<T>(1));
# endif
// -- Implicit basic constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)

View File

@ -29,6 +29,7 @@
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#define GLM_STATIC_CONST_MEMBERS
#if !(GLM_COMPILER & GLM_COMPILER_GCC)
# define GLM_META_PROG_HELPERS
#endif
@ -40,6 +41,7 @@
# include <type_traits>
#endif
int test_vec2_operators()
{
int Error = 0;