1 /// @ref core 2 /// @file glm/detail/type_float.hpp 3 4 #pragma once 5 6 #include "setup.hpp" 7 8 namespace glm{ 9 namespace detail 10 { 11 typedef float float32; 12 typedef double float64; 13 }//namespace detail 14 15 typedef float lowp_float_t; 16 typedef float mediump_float_t; 17 typedef double highp_float_t; 18 19 /// @addtogroup core_precision 20 /// @{ 21 22 /// Low precision floating-point numbers. 23 /// There is no guarantee on the actual precision. 24 /// 25 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.4 Floats</a> 26 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 27 typedef lowp_float_t lowp_float; 28 29 /// Medium precision floating-point numbers. 30 /// There is no guarantee on the actual precision. 31 /// 32 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.4 Floats</a> 33 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 34 typedef mediump_float_t mediump_float; 35 36 /// High precision floating-point numbers. 37 /// There is no guarantee on the actual precision. 38 /// 39 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.4 Floats</a> 40 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a> 41 typedef highp_float_t highp_float; 42 43 #if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) 44 typedef mediump_float float_t; 45 #elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) 46 typedef highp_float float_t; 47 #elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) 48 typedef mediump_float float_t; 49 #elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT)) 50 typedef lowp_float float_t; 51 #else 52 # error "GLM error: multiple default precision requested for floating-point types" 53 #endif 54 55 typedef float float32; 56 typedef double float64; 57 58 //////////////////// 59 // check type sizes 60 #ifndef GLM_STATIC_ASSERT_NULL 61 GLM_STATIC_ASSERT(sizeof(glm::float32) == 4, "float32 size isn't 4 bytes on this platform"); 62 GLM_STATIC_ASSERT(sizeof(glm::float64) == 8, "float64 size isn't 8 bytes on this platform"); 63 #endif//GLM_STATIC_ASSERT_NULL 64 65 /// @} 66 67 }//namespace glm 68