- Added GLM_FORCE_UNRESTRICTED_GENTYPE allowing non basic genType #543

This commit is contained in:
Christophe Riccio
2016-09-01 23:32:12 +02:00
parent 1c5fd06c2d
commit 10dc67e2b5
12 changed files with 56 additions and 39 deletions

View File

@@ -1,5 +1,5 @@
#define GLM_MESSAGES
#define GLM_SWIZZLE
#define GLM_FORCE_SWIZZLE
#include <glm/glm.hpp>
int test_ivec2_swizzle()

View File

@@ -1,4 +1,4 @@
#define GLM_SWIZZLE
#define GLM_FORCE_SWIZZLE
#include <glm/vector_relational.hpp>
#include <glm/gtc/vec1.hpp>
#include <vector>
@@ -65,7 +65,7 @@ int test_vec1_ctor()
}
#endif
*/
#if GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_SWIZZLE)
#if GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_FORCE_SWIZZLE)
{
glm::vec2 A = glm::vec2(1.0f, 2.0f);
glm::vec2 B = A.xy;
@@ -76,7 +76,7 @@ int test_vec1_ctor()
Error += glm::all(glm::equal(A, C)) ? 0 : 1;
Error += glm::all(glm::equal(A, D)) ? 0 : 1;
}
#endif//GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_SWIZZLE)
#endif//GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_FORCE_SWIZZLE)
{
glm::vec2 A = glm::vec2(2.0f);

View File

@@ -1,4 +1,4 @@
#define GLM_SWIZZLE
#define GLM_FORCE_SWIZZLE
#include <glm/vector_relational.hpp>
#include <glm/vec2.hpp>
#include <vector>
@@ -230,7 +230,7 @@ int test_vec2_ctor()
}
#endif
#if GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_SWIZZLE)
#if GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_FORCE_SWIZZLE)
{
glm::vec2 A = glm::vec2(1.0f, 2.0f);
glm::vec2 B = A.xy;
@@ -241,7 +241,7 @@ int test_vec2_ctor()
Error += glm::all(glm::equal(A, C)) ? 0 : 1;
Error += glm::all(glm::equal(A, D)) ? 0 : 1;
}
#endif//GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_SWIZZLE)
#endif//GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_FORCE_SWIZZLE)
{
glm::vec2 A = glm::vec2(2.0f);

View File

@@ -1,4 +1,4 @@
#define GLM_SWIZZLE
#define GLM_FORCE_SWIZZLE
#include <glm/vector_relational.hpp>
#include <glm/geometric.hpp>
#include <glm/vec2.hpp>
@@ -40,7 +40,7 @@ int test_vec3_ctor()
}
#endif
#if(GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_SWIZZLE))
#if(GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_FORCE_SWIZZLE))
{
glm::vec3 A = glm::vec3(1.0f, 2.0f, 3.0f);
glm::vec3 B = A.xyz;
@@ -59,7 +59,7 @@ int test_vec3_ctor()
Error += glm::all(glm::equal(A, G)) ? 0 : 1;
Error += glm::all(glm::equal(A, H)) ? 0 : 1;
}
#endif//(GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_SWIZZLE))
#endif//(GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_FORCE_SWIZZLE))
{
glm::vec3 A(1);

View File

@@ -1,5 +1,5 @@
#define GLM_FORCE_ALIGNED
#define GLM_SWIZZLE
#define GLM_FORCE_SWIZZLE
#include <glm/vector_relational.hpp>
#include <glm/vec2.hpp>
#include <glm/vec3.hpp>
@@ -68,7 +68,7 @@ int test_vec4_ctor()
}
#endif
#if GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_SWIZZLE)
#if GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_FORCE_SWIZZLE)
{
glm::vec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f);
glm::vec4 B = A.xyzw;
@@ -97,7 +97,7 @@ int test_vec4_ctor()
Error += glm::all(glm::equal(A, L)) ? 0 : 1;
Error += glm::all(glm::equal(A, M)) ? 0 : 1;
}
#endif// GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_SWIZZLE)
#endif// GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_FORCE_SWIZZLE)
{
glm::vec4 A(1);