diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index ac444b42..f15e85ef 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -630,6 +630,63 @@ namespace glm # define GLM_CONFIG_ANONYMOUS_STRUCT GLM_DISABLE #endif +/////////////////////////////////////////////////////////////////////////////////// +// Precision + +#define GLM_HIGHP 1 +#define GLM_MEDIUMP 2 +#define GLM_LOWP 3 + +#ifdef GLM_PRECISION_HIGHP_BOOL +# define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP +#elif defined(GLM_PRECISION_MEDIUMP_BOOL) +# define GLM_CONFIG_PRECISION_BOOL GLM_MEDIUMP +#elif defined(GLM_PRECISION_LOWP_BOOL) +# define GLM_CONFIG_PRECISION_BOOL GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP +#endif + +#ifdef GLM_PRECISION_HIGHP_INT +# define GLM_CONFIG_PRECISION_INT GLM_HIGHP +#elif defined(GLM_PRECISION_MEDIUMP_INT) +# define GLM_CONFIG_PRECISION_INT GLM_MEDIUMP +#elif defined(GLM_PRECISION_LOWP_INT) +# define GLM_CONFIG_PRECISION_INT GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_INT GLM_HIGHP +#endif + +#ifdef GLM_PRECISION_HIGHP_UINT +# define GLM_CONFIG_PRECISION_UINT GLM_HIGHP +#elif defined(GLM_PRECISION_MEDIUMP_UINT) +# define GLM_CONFIG_PRECISION_UINT GLM_MEDIUMP +#elif defined(GLM_PRECISION_LOWP_UINT) +# define GLM_CONFIG_PRECISION_UINT GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_UINT GLM_HIGHP +#endif + +#ifdef GLM_PRECISION_HIGHP_FLOAT +# define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP +#elif defined(GLM_PRECISION_MEDIUMP_FLOAT) +# define GLM_CONFIG_PRECISION_FLOAT GLM_MEDIUMP +#elif defined(GLM_PRECISION_LOWP_FLOAT) +# define GLM_CONFIG_PRECISION_FLOAT GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP +#endif + +#ifdef GLM_PRECISION_HIGHP_DOUBLE +# define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP +#elif defined(GLM_PRECISION_MEDIUMP_DOUBLE) +# define GLM_CONFIG_PRECISION_DOUBLE GLM_MEDIUMP +#elif defined(GLM_PRECISION_LOWP_DOUBLE) +# define GLM_CONFIG_PRECISION_DOUBLE GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP +#endif + /////////////////////////////////////////////////////////////////////////////////// // Check inclusions of different versions of GLM diff --git a/glm/detail/type_float.hpp b/glm/detail/type_float.hpp index 28abb5f8..8941b48b 100644 --- a/glm/detail/type_float.hpp +++ b/glm/detail/type_float.hpp @@ -43,22 +43,18 @@ namespace detail /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier typedef highp_float_t highp_float; -#if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef mediump_float float_t; -#elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) +#if GLM_CONFIG_PRECISION_FLOAT == GLM_HIGHP typedef highp_float float_t; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) +#elif GLM_CONFIG_PRECISION_FLOAT == GLM_MEDIUMP typedef mediump_float float_t; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT)) +#elif GLM_CONFIG_PRECISION_FLOAT == GLM_LOWP typedef lowp_float float_t; -#else -# error "GLM error: multiple default precision requested for floating-point types" #endif typedef float float32; # ifndef GLM_FORCE_SINGLE_ONLY - typedef double float64; + typedef double float64; # endif//GLM_FORCE_SINGLE_ONLY //////////////////// diff --git a/glm/ext/vector_bvec1.hpp b/glm/ext/vector_bvec1.hpp index ffedcec1..c2a24839 100644 --- a/glm/ext/vector_bvec1.hpp +++ b/glm/ext/vector_bvec1.hpp @@ -1,21 +1,21 @@ -/// @ref ext_bvec1 -/// @file glm/ext/bvec1.hpp +/// @ref ext_vector_bvec1 +/// @file glm/ext/vector_bvec1.hpp /// /// @see core (dependence) /// -/// @defgroup ext_bvec1 GLM_EXT_bvec1 +/// @defgroup ext_vector_bvec1 GLM_EXT_vector_bvec1 /// @ingroup ext /// -/// Include to use the features of this extension. +/// Include to use the features of this extension. /// -/// Expose bvec1 type. +/// Exposes bvec1 vector type. #pragma once #include "../detail/type_vec1.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_bvec1 extension included") +# pragma message("GLM: GLM_EXT_vector_bvec1 extension included") #endif namespace glm @@ -23,16 +23,16 @@ namespace glm /// @addtogroup ext_bvec1 /// @{ -# if(defined(GLM_PRECISION_LOWP_BOOL)) +# if GLM_CONFIG_PRECISION_BOOL == GLM_LOWP typedef vec<1, bool, lowp> bvec1; -# elif(defined(GLM_PRECISION_MEDIUMP_BOOL)) +# elif GLM_CONFIG_PRECISION_BOOL == GLM_MEDIUMP typedef vec<1, bool, mediump> bvec1; -# else //defined(GLM_PRECISION_HIGHP_BOOL) +# else /// 1 components vector of boolean. /// - /// @see ext_bvec1 extension. + /// @see ext_vector_bvec1 extension. typedef vec<1, bool, highp> bvec1; -# endif//GLM_PRECISION +# endif /// @} }//namespace glm diff --git a/glm/ext/vector_bvec1_precision.hpp b/glm/ext/vector_bvec1_precision.hpp index 1ec3b898..8309240d 100644 --- a/glm/ext/vector_bvec1_precision.hpp +++ b/glm/ext/vector_bvec1_precision.hpp @@ -1,41 +1,41 @@ -/// @ref ext_bvec1_precision -/// @file glm/ext/bvec1_precision.hpp +/// @ref ext_vector_bvec1_precision +/// @file glm/ext/vector_bvec1_precision.hpp /// /// @see core (dependence) /// -/// @defgroup ext_bvec1_precision GLM_EXT_bvec1_precision +/// @defgroup ext_vector_bvec1_precision GLM_EXT_vector_bvec1_precision /// @ingroup ext /// -/// Include to use the features of this extension. +/// Include to use the features of this extension. /// -/// Add Exposes highp_bvec1, mediump_bvec1 and lowp_bvec1 types. +/// Exposes highp_bvec1, mediump_bvec1 and lowp_bvec1 types. #pragma once #include "../detail/type_vec1.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_bvec1_precision extension included") +# pragma message("GLM: GLM_EXT_vector_bvec1_precision extension included") #endif namespace glm { - /// @addtogroup ext_bvec1_precision + /// @addtogroup ext_vector_bvec1_precision /// @{ /// 1 component vector of bool values. /// - /// @see ext_vec1 + /// @see ext_vector_bvec1_precision typedef vec<1, bool, highp> highp_bvec1; /// 1 component vector of bool values. /// - /// @see ext_vec1 + /// @see ext_vector_bvec1_precision typedef vec<1, bool, mediump> mediump_bvec1; /// 1 component vector of bool values. /// - /// @see ext_vec1 + /// @see ext_vector_bvec1_precision typedef vec<1, bool, lowp> lowp_bvec1; /// @} diff --git a/glm/ext/vector_dvec1.hpp b/glm/ext/vector_dvec1.hpp index 23a66b6c..400625fb 100644 --- a/glm/ext/vector_dvec1.hpp +++ b/glm/ext/vector_dvec1.hpp @@ -1,12 +1,12 @@ -/// @ref ext_dvec1 -/// @file glm/ext/dvec1.hpp +/// @ref ext_vector_dvec1 +/// @file glm/ext/vector_dvec1.hpp /// /// @see core (dependence) /// -/// @defgroup ext_dvec1 GLM_EXT_dvec1 +/// @defgroup ext_vector_dvec1 GLM_EXT_vector_dvec1 /// @ingroup ext /// -/// Include to use the features of this extension. +/// Include to use the features of this extension. /// /// Expose dvec1 vector type. @@ -15,24 +15,24 @@ #include "../detail/type_vec1.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_dvec1 extension included") +# pragma message("GLM: GLM_EXT_vector_dvec1 extension included") #endif namespace glm { - /// @addtogroup ext_dvec1 + /// @addtogroup ext_vector_dvec1 /// @{ -# if(defined(GLM_PRECISION_LOWP_DOUBLE)) +# if GLM_CONFIG_PRECISION_DOUBLE == GLM_LOWP typedef vec<1, double, lowp> dvec1; -# elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) +# elif GLM_CONFIG_PRECISION_DOUBLE == GLM_MEDIUMP typedef vec<1, double, mediump> dvec1; -# else //defined(GLM_PRECISION_HIGHP_DOUBLE) +# else /// 1 components vector of double-precision floating-point numbers. /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see ext_vector_dvec1 extension. typedef vec<1, double, highp> dvec1; -# endif//GLM_PRECISION +# endif /// @} }//namespace glm diff --git a/glm/ext/vector_dvec1_precision.hpp b/glm/ext/vector_dvec1_precision.hpp index 2299f65c..cfcdb48d 100644 --- a/glm/ext/vector_dvec1_precision.hpp +++ b/glm/ext/vector_dvec1_precision.hpp @@ -1,12 +1,12 @@ -/// @ref ext_dvec1_precision -/// @file glm/ext/dvec1_precision.hpp +/// @ref ext_vector_dvec1_precision +/// @file glm/ext/vector_dvec1_precision.hpp /// /// @see core (dependence) /// -/// @defgroup ext_dvec1_precision GLM_EXT_dvec1_precision +/// @defgroup ext_vector_dvec1_precision GLM_EXT_vector_dvec1_precision /// @ingroup ext /// -/// Include to use the features of this extension. +/// Include to use the features of this extension. /// /// Exposes highp_dvec1, mediump_dvec1 and lowp_dvec1 types. @@ -15,27 +15,27 @@ #include "../detail/type_vec1.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_dvec1_precision extension included") +# pragma message("GLM: GLM_EXT_vector_dvec1_precision extension included") #endif namespace glm { - /// @addtogroup ext_dvec1_precision + /// @addtogroup ext_vector_dvec1_precision /// @{ /// 1 component vector of double-precision floating-point numbers using high precision arithmetic in term of ULPs. /// - /// @see ext_dvec1_precision + /// @see ext_vector_dvec1_precision typedef vec<1, double, highp> highp_dvec1; /// 1 component vector of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. /// - /// @see ext_dvec1_precision + /// @see ext_vector_dvec1_precision typedef vec<1, double, mediump> mediump_dvec1; /// 1 component vector of double-precision floating-point numbers using low precision arithmetic in term of ULPs. /// - /// @see ext_dvec1_precision + /// @see ext_vector_dvec1_precision typedef vec<1, double, lowp> lowp_dvec1; /// @} diff --git a/glm/ext/vector_ivec1.hpp b/glm/ext/vector_ivec1.hpp index fb03ede5..27c9ca9e 100644 --- a/glm/ext/vector_ivec1.hpp +++ b/glm/ext/vector_ivec1.hpp @@ -1,12 +1,12 @@ -/// @ref ext_ivec1 -/// @file glm/ext/ivec1.hpp +/// @ref ext_vector_ivec1 +/// @file glm/ext/vector_ivec1.hpp /// /// @see core (dependence) /// -/// @defgroup ext_ivec1 GLM_EXT_ivec1 +/// @defgroup ext_vector_ivec1 GLM_EXT_vector_ivec1 /// @ingroup ext /// -/// Include to use the features of this extension. +/// Include to use the features of this extension. /// /// Exposes ivec1 vector type. @@ -15,24 +15,24 @@ #include "../detail/type_vec1.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_ivec1 extension included") +# pragma message("GLM: GLM_EXT_vector_ivec1 extension included") #endif namespace glm { - /// @addtogroup ext_ivec1 + /// @addtogroup ext_vector_ivec1 /// @{ -# if(defined(GLM_PRECISION_LOWP_INT)) +# if GLM_CONFIG_PRECISION_INT == GLM_LOWP typedef vec<1, int, lowp> ivec1; -# elif(defined(GLM_PRECISION_MEDIUMP_INT)) +# elif GLM_CONFIG_PRECISION_INT == GLM_MEDIUMP typedef vec<1, int, mediump> ivec1; - #else //defined(GLM_PRECISION_HIGHP_INT) +# else /// 1 component vector of signed integer numbers. /// - /// @see ext_ivec1 extension. + /// @see ext_vector_ivec1 extension. typedef vec<1, int, highp> ivec1; -# endif//GLM_PRECISION +# endif /// @} }//namespace glm diff --git a/glm/ext/vector_uvec1.hpp b/glm/ext/vector_uvec1.hpp index 711a6dc2..3e7c6a9c 100644 --- a/glm/ext/vector_uvec1.hpp +++ b/glm/ext/vector_uvec1.hpp @@ -1,12 +1,12 @@ -/// @ref ext_uvec1 -/// @file glm/ext/uvec1.hpp +/// @ref ext_vector_uvec1 +/// @file glm/ext/vector_uvec1.hpp /// /// @see core (dependence) /// -/// @defgroup ext_uvec1 GLM_EXT_uvec1 +/// @defgroup ext_vector_uvec1 GLM_EXT_vector_uvec1 /// @ingroup ext /// -/// Include to use the features of this extension. +/// Include to use the features of this extension. /// /// Exposes uvec1 vector type. @@ -15,24 +15,24 @@ #include "../detail/type_vec1.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_uvec1 extension included") +# pragma message("GLM: GLM_EXT_vector_uvec1 extension included") #endif namespace glm { - /// @addtogroup ext_uvec1 + /// @addtogroup ext_vector_uvec1 /// @{ -# if(defined(GLM_PRECISION_LOWP_INT)) - typedef vec<1, uint, lowp> uvec1; -# elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef vec<1, uint, mediump> uvec1; -#else //defined(GLM_PRECISION_HIGHP_INT) - /// 1 component vector of unsigned integer numbers. - /// - /// @see ext_uvec1 extension. - typedef vec<1, uint, highp> uvec1; -# endif//GLM_PRECISION +# if GLM_CONFIG_PRECISION_UINT == GLM_LOWP + typedef vec<1, uint, lowp> uvec1; +# elif GLM_CONFIG_PRECISION_UINT == GLM_MEDIUMP + typedef vec<1, uint, mediump> uvec1; +# else + /// 1 component vector of unsigned integer numbers. + /// + /// @see ext_vector_uvec1 extension. + typedef vec<1, uint, highp> uvec1; +# endif /// @} }//namespace glm diff --git a/glm/ext/vector_vec1.hpp b/glm/ext/vector_vec1.hpp index 5d605305..f962bab3 100644 --- a/glm/ext/vector_vec1.hpp +++ b/glm/ext/vector_vec1.hpp @@ -1,38 +1,38 @@ -/// @ref ext_vec1 -/// @file glm/ext/vec1.hpp +/// @ref ext_vector_vec1 +/// @file glm/ext/vector_vec1.hpp /// /// @see core (dependence) /// -/// @defgroup ext_vec1 GLM_EXT_fvec1 +/// @defgroup ext_vector_vec1 GLM_EXT_vector_vec1 /// @ingroup ext /// -/// Include to use the features of this extension. +/// Include to use the features of this extension. /// -/// Expose vec1 vector type. +/// Exposes vec1 vector type. #pragma once #include "../detail/type_vec1.hpp" #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_fvec1 extension included") +# pragma message("GLM: GLM_EXT_vector_vec1 extension included") #endif namespace glm { - /// @addtogroup ext_fvec1 + /// @addtogroup ext_vector_vec1 /// @{ -# if(defined(GLM_PRECISION_LOWP_FLOAT)) +# if GLM_CONFIG_PRECISION_FLOAT == GLM_LOWP typedef vec<1, float, lowp> vec1; -# elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) +# elif GLM_CONFIG_PRECISION_FLOAT == GLM_MEDIUMP typedef vec<1, float, mediump> vec1; -# else //defined(GLM_PRECISION_HIGHP_FLOAT) +# else /// 1 components vector of single-precision floating-point numbers. /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see ext_vector_vec1 extension. typedef vec<1, float, highp> vec1; -# endif//GLM_PRECISION +# endif /// @} }//namespace glm