Fixed GTC_packing build

This commit is contained in:
Christophe Riccio
2013-09-01 18:22:47 +02:00
parent 36a5f1cc20
commit 635d2d0eca
3 changed files with 192 additions and 234 deletions

View File

@@ -7,24 +7,11 @@
// File : test/core/core_func_swizzle.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef GLM_FORCE_ONLY_XYZW
# define GLM_FORCE_ONLY_XYZW
#endif
//#ifndef GLM_FORCE_PURE
//# define GLM_FORCE_PURE
//#endif
#ifndef GLM_MESSAGES
# define GLM_MESSAGES
#endif
#ifndef GLM_SWIZZLE
# define GLM_SWIZZLE
#endif
#ifndef GLM_FORCE_CXX98
# define GLM_FORCE_CXX98
#endif
#define GLM_MESSAGES
#define GLM_SWIZZLE
#include <glm/glm.hpp>
int test_vec2_swizzle()
int test_ivec2_swizzle()
{
int Error = 0;
@@ -39,7 +26,7 @@ int test_vec2_swizzle()
return Error;
}
int test_vec3_swizzle()
int test_ivec3_swizzle()
{
int Error = 0;
@@ -54,7 +41,7 @@ int test_vec3_swizzle()
return Error;
}
int test_vec4_swizzle()
int test_ivec4_swizzle()
{
int Error = 0;
@@ -69,12 +56,33 @@ int test_vec4_swizzle()
return Error;
}
int test_vec4_swizzle()
{
int Error = 0;
glm::vec4 A(1, 2, 3, 4);
glm::vec4 B = A.xyzw();
glm::vec4 C(0);
C.xyzw = B.xyzw;
float f = glm::dot(C.wzyx(), C.xyzw());
Error += A == B ? 0 : 1;
Error += A == C ? 0 : 1;
static_assert(sizeof(int) <= 4, "Test");
return Error;
}
int main()
{
int Error = 0;
Error += test_vec2_swizzle();
Error += test_vec3_swizzle();
Error += test_ivec2_swizzle();
Error += test_ivec3_swizzle();
Error += test_ivec4_swizzle();
Error += test_vec4_swizzle();
return Error;