mirror of
https://github.com/g-truc/glm.git
synced 2025-04-05 05:25:02 +00:00
Completed new precision API
This commit is contained in:
parent
334acfa7aa
commit
e2f8c06e85
5 changed files with 25 additions and 46 deletions
|
@ -401,21 +401,4 @@
|
|||
# endif
|
||||
#endif//GLM_MESSAGE
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Precision
|
||||
/*
|
||||
#define GLM_PRECISION_NONE 0x00000000
|
||||
|
||||
#define GLM_PRECISION_LOWP_FLOAT 0x00000011
|
||||
#define GLM_PRECISION_MEDIUMP_FLOAT 0x00000012
|
||||
#define GLM_PRECISION_HIGHP_FLOAT 0x00000013
|
||||
|
||||
#define GLM_PRECISION_LOWP_INT 0x00001100
|
||||
#define GLM_PRECISION_MEDIUMP_INT 0x00001200
|
||||
#define GLM_PRECISION_HIGHP_INT 0x00001300
|
||||
|
||||
#define GLM_PRECISION_LOWP_UINT 0x00110000
|
||||
#define GLM_PRECISION_MEDIUMP_UINT 0x00120000
|
||||
#define GLM_PRECISION_HIGHP_UINT 0x00130000
|
||||
*/
|
||||
#endif//glm_setup
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace type
|
|||
//////////////////////////
|
||||
// Float definition
|
||||
|
||||
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)
|
||||
#if(defined(GLM_PRECISION_HIGHP_FLOAT))
|
||||
typedef precision::highp_vec2 vec2;
|
||||
typedef precision::highp_vec3 vec3;
|
||||
typedef precision::highp_vec4 vec4;
|
||||
|
@ -51,7 +51,7 @@ namespace type
|
|||
typedef precision::highp_mat4x2 mat4x2;
|
||||
typedef precision::highp_mat4x3 mat4x3;
|
||||
typedef precision::highp_mat4x4 mat4x4;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
|
||||
typedef precision::mediump_vec2 vec2;
|
||||
typedef precision::mediump_vec3 vec3;
|
||||
typedef precision::mediump_vec4 vec4;
|
||||
|
@ -64,7 +64,7 @@ namespace type
|
|||
typedef precision::mediump_mat4x2 mat4x2;
|
||||
typedef precision::mediump_mat4x3 mat4x3;
|
||||
typedef precision::mediump_mat4x4 mat4x4;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)
|
||||
#elif(defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef precision::lowp_vec2 vec2;
|
||||
typedef precision::lowp_vec3 vec3;
|
||||
typedef precision::lowp_vec4 vec4;
|
||||
|
@ -158,15 +158,15 @@ namespace type
|
|||
//////////////////////////
|
||||
// Signed integer definition
|
||||
|
||||
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_INT)
|
||||
#if(defined(GLM_PRECISION_HIGHP_INT))
|
||||
typedef precision::highp_ivec2 ivec2;
|
||||
typedef precision::highp_ivec3 ivec3;
|
||||
typedef precision::highp_ivec4 ivec4;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
|
||||
typedef precision::mediump_ivec2 ivec2;
|
||||
typedef precision::mediump_ivec3 ivec3;
|
||||
typedef precision::mediump_ivec4 ivec4;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_INT)
|
||||
#elif(defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef precision::lowp_ivec2 ivec2;
|
||||
typedef precision::lowp_ivec3 ivec3;
|
||||
typedef precision::lowp_ivec4 ivec4;
|
||||
|
@ -190,15 +190,15 @@ namespace type
|
|||
//////////////////////////
|
||||
// Unsigned integer definition
|
||||
|
||||
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)
|
||||
#if(defined(GLM_PRECISION_HIGHP_UINT))
|
||||
typedef precision::highp_uvec2 uvec2;
|
||||
typedef precision::highp_uvec3 uvec3;
|
||||
typedef precision::highp_uvec4 uvec4;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_UINT))
|
||||
typedef precision::mediump_uvec2 uvec2;
|
||||
typedef precision::mediump_uvec3 uvec3;
|
||||
typedef precision::mediump_uvec4 uvec4;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_UINT)
|
||||
#elif(defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef precision::lowp_uvec2 uvec2;
|
||||
typedef precision::lowp_uvec3 uvec3;
|
||||
typedef precision::lowp_uvec4 uvec4;
|
||||
|
|
|
@ -117,11 +117,10 @@ namespace glm
|
|||
typedef detail::tmat4x3<lowp_uint> lowp_umat4x3; //!< \brief Low-precision signed integer 4x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef detail::tmat4x4<lowp_uint> lowp_umat4x4; //!< \brief Low-precision signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
#if(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_HIGHP_INT))
|
||||
#if(defined(GLM_PRECISION_HIGHP_INT))
|
||||
typedef highp_imat2 imat2; //!< \brief Signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_imat3 imat3; //!< \brief Signed integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_imat4 imat4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
typedef highp_imat2x2 imat2x2; //!< \brief Signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_imat2x3 imat2x3; //!< \brief Signed integer 2x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_imat2x4 imat2x4; //!< \brief Signed integer 2x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
@ -131,8 +130,7 @@ namespace glm
|
|||
typedef highp_imat4x2 imat4x2; //!< \brief Signed integer 4x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_imat4x3 imat4x3; //!< \brief Signed integer 4x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_imat4x4 imat4x4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
#elif(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_LOWP_INT))
|
||||
#elif(defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef lowp_imat2 imat2; //!< \brief Signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_imat3 imat3; //!< \brief Signed integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_imat4 imat4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
@ -145,8 +143,7 @@ namespace glm
|
|||
typedef lowp_imat4x2 imat4x2; //!< \brief Signed integer 4x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_imat4x3 imat4x3; //!< \brief Signed integer 4x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_imat4x4 imat4x4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
#else //if(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT))
|
||||
#else //if(defined(GLM_PRECISION_MEDIUMP_INT))
|
||||
typedef mediump_imat2 imat2; //!< \brief Signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef mediump_imat3 imat3; //!< \brief Signed integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef mediump_imat4 imat4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
@ -161,7 +158,7 @@ namespace glm
|
|||
typedef mediump_imat4x4 imat4x4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
#if(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_HIGHP_UINT))
|
||||
#if(defined(GLM_PRECISION_HIGHP_UINT))
|
||||
typedef highp_umat2 umat2; //!< \brief Unsigned integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_umat3 umat3; //!< \brief Unsigned integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_umat4 umat4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
@ -174,8 +171,7 @@ namespace glm
|
|||
typedef highp_umat4x2 umat4x2; //!< \brief Unsigned integer 4x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_umat4x3 umat4x3; //!< \brief Unsigned integer 4x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_umat4x4 umat4x4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
#elif(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_LOWP_UINT))
|
||||
#elif(defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef lowp_umat2 umat2; //!< \brief Unsigned integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_umat3 umat3; //!< \brief Unsigned integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_umat4 umat4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
@ -188,8 +184,7 @@ namespace glm
|
|||
typedef lowp_umat4x2 umat4x2; //!< \brief Unsigned integer 4x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_umat4x3 umat4x3; //!< \brief Unsigned integer 4x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_umat4x4 umat4x4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
#else //if(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT))
|
||||
#else //if(defined(GLM_PRECISION_MEDIUMP_UINT))
|
||||
typedef mediump_umat2 umat2; //!< \brief Unsigned integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef mediump_umat3 umat3; //!< \brief Unsigned integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef mediump_umat4 umat4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
|
|
@ -80,11 +80,11 @@ namespace glm
|
|||
//! From GLM_GTX_vec1 extension.
|
||||
typedef detail::tvec1<bool> bvec1;
|
||||
|
||||
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)
|
||||
#if(defined(GLM_PRECISION_HIGHP_FLOAT))
|
||||
typedef precision::highp_vec1 vec1;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
|
||||
typedef precision::mediump_vec1 vec1;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)
|
||||
#elif(defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef precision::lowp_vec1 vec1;
|
||||
#else
|
||||
//! 1 component vector of floating-point numbers.
|
||||
|
@ -92,11 +92,11 @@ namespace glm
|
|||
typedef precision::mediump_vec1 vec1;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_INT)
|
||||
#if(defined(GLM_PRECISION_HIGHP_INT))
|
||||
typedef precision::highp_ivec1 ivec1;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
|
||||
typedef precision::mediump_ivec1 ivec1;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_INT)
|
||||
#elif(defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef precision::lowp_ivec1 ivec1;
|
||||
#else
|
||||
//! 1 component vector of signed integer numbers.
|
||||
|
@ -104,11 +104,11 @@ namespace glm
|
|||
typedef precision::mediump_ivec1 ivec1;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)
|
||||
#if(defined(GLM_PRECISION_HIGHP_UINT))
|
||||
typedef precision::highp_uvec1 uvec1;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_UINT))
|
||||
typedef precision::mediump_uvec1 uvec1;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_UINT)
|
||||
#elif(defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef precision::lowp_uvec1 uvec1;
|
||||
#else
|
||||
//! 1 component vector of unsigned integer numbers.
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define GLM_MESSAGES
|
||||
#define GLM_PRECISION_HIGHP_FLOAT
|
||||
#include <glm/glm.hpp>
|
||||
#include <cstdio>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue