Added new default precision API

master
Christophe Riccio ago%!(EXTRA string=14 years)
parent e106bd62cf
commit f4d6be2064
  1. 13
      glm/core/type_float.hpp
  2. 26
      glm/core/type_int.hpp

@ -55,18 +55,17 @@ namespace glm
} }
//namespace precision //namespace precision
#ifndef GLM_PRECISION #if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::mediump_float float_t; typedef precision::mediump_float float_t;
#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT) #elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::highp_float float_t; typedef precision::highp_float float_t;
#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT) #elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::mediump_float float_t; typedef precision::mediump_float float_t;
#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT) #elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT))
typedef precision::lowp_float float_t; typedef precision::lowp_float float_t;
#else #else
# pragma message("GLM message: Precisson undefined for float numbers."); # error "GLM error: multiple default precision requested for floating-point types"
typedef precision::mediump_float float_t; #endif
#endif//GLM_PRECISION
}//namespace type }//namespace type
}//namespace core }//namespace core

@ -79,31 +79,29 @@ namespace glm
} }
//namespace precision //namespace precision
#ifndef GLM_PRECISION #if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef precision::mediump_int int_t; typedef precision::mediump_int int_t;
#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT) #elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef precision::highp_int int_t; typedef precision::highp_int int_t;
#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT) #elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
typedef precision::mediump_int int_t; typedef precision::mediump_int int_t;
#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT) #elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
typedef precision::lowp_int int_t; typedef precision::lowp_int int_t;
#else #else
typedef precision::mediump_int int_t; # error "GLM error: multiple default precision requested for signed interger types"
# pragma message("GLM message: Precisson undefined for signed integer number."); #endif
#endif//GLM_PRECISION
#ifndef GLM_PRECISION #if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
typedef precision::mediump_uint uint_t; typedef precision::mediump_uint uint_t;
#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT) #elif(defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
typedef precision::highp_uint uint_t; typedef precision::highp_uint uint_t;
#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT) #elif(!defined(GLM_PRECISION_HIGHP_UINT) && defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
typedef precision::mediump_uint uint_t; typedef precision::mediump_uint uint_t;
#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT) #elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))
typedef precision::lowp_uint uint_t; typedef precision::lowp_uint uint_t;
#else #else
typedef precision::mediump_uint uint_t; # error "GLM error: multiple default precision requested for unsigned interger types"
# pragma message("GLM message: Precisson undefined for unsigned integer number."); #endif
#endif//GLM_PRECISION
//! Unsigned integer. //! Unsigned integer.
//! From GLSL 1.30.8 specification section 4.1.3 Integers. //! From GLSL 1.30.8 specification section 4.1.3 Integers.

Loading…
Cancel
Save