Fixed merge

This commit is contained in:
Christophe Riccio 2011-09-18 19:01:49 +01:00
commit ac869c9faa
4 changed files with 56 additions and 6 deletions

View File

@ -20,10 +20,15 @@ int test_float_size()
int test_float_precision()
{
return (
sizeof(glm::lowp_float) <= sizeof(glm::mediump_float) &&
sizeof(glm::lowp_float) <= sizeof(glm::mediump_float) &&
sizeof(glm::mediump_float) <= sizeof(glm::highp_float)) ? 0 : 1;
}
int test_vec2()
{
return 0;
}
int main()
{
int Error = 0;

View File

@ -91,10 +91,25 @@ int test_vec2_ctor()
return Error;
}
int test_vec2_size()
{
int Error = 0;
Error += sizeof(glm::vec2) == sizeof(glm::mediump_vec2) ? 0 : 1;
Error += 8 == sizeof(glm::mediump_vec2) ? 0 : 1;
Error += sizeof(glm::dvec2) == sizeof(glm::highp_vec2) ? 0 : 1;
Error += 16 == sizeof(glm::highp_vec2) ? 0 : 1;
Error += glm::vec2().length() == 2 ? 0 : 1;
Error += glm::dvec2().length() == 2 ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += test_vec2_size();
Error += test_vec2_ctor();
Error += test_vec2_operators();

View File

@ -2,14 +2,14 @@
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2008-08-31
// Updated : 2008-08-31
// Updated : 2011-09-19
// Licence : This source is under MIT License
// File : test/core/type_vec3.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
static int test_operators()
static int test_vec3_operators()
{
glm::vec3 A(1.0f);
glm::vec3 B(1.0f);
@ -19,11 +19,26 @@ static int test_operators()
return (S && !R) ? 0 : 1;
}
int test_vec3_size()
{
int Error = 0;
Error += sizeof(glm::vec3) == sizeof(glm::mediump_vec3) ? 0 : 1;
Error += 12 == sizeof(glm::mediump_vec3) ? 0 : 1;
Error += sizeof(glm::dvec3) == sizeof(glm::highp_vec3) ? 0 : 1;
Error += 24 == sizeof(glm::highp_vec3) ? 0 : 1;
Error += glm::vec3().length() == 3 ? 0 : 1;
Error += glm::dvec3().length() == 3 ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += test_operators();
Error += test_vec3_operators();
Error += test_vec3_size();
return Error;
}

View File

@ -41,7 +41,7 @@ int test_hvec4()
return 0;
}
static int test_operators()
int test_vec4_operators()
{
glm::vec4 A(1.0f);
glm::vec4 B(1.0f);
@ -51,13 +51,28 @@ static int test_operators()
return (S && !R) ? 0 : 1;
}
int test_vec4_size()
{
int Error = 0;
Error += sizeof(glm::vec4) == sizeof(glm::mediump_vec4) ? 0 : 1;
Error += 16 == sizeof(glm::mediump_vec4) ? 0 : 1;
Error += sizeof(glm::dvec4) == sizeof(glm::highp_vec4) ? 0 : 1;
Error += 32 == sizeof(glm::highp_vec4) ? 0 : 1;
Error += glm::vec4().length() == 4 ? 0 : 1;
Error += glm::dvec4().length() == 4 ? 0 : 1;
return Error;
}
int main()
{
//__m128 DataA = swizzle<X, Y, Z, W>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
//__m128 DataB = swizzle<W, Z, Y, X>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
int Error = 0;
Error += test_operators();
Error += test_vec4_size();
Error += test_vec4_operators();
Error += test_hvec4();
return Error;
}