Added GTC_type_aligned with aligned *vec* types

This commit is contained in:
Christophe Riccio
2016-06-01 00:43:35 +02:00
parent d6b70f3414
commit 41984e42ab
22 changed files with 607 additions and 276 deletions

View File

@@ -29,6 +29,7 @@
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_ALIGNED
#define GLM_SWIZZLE
#include <glm/vector_relational.hpp>
#include <glm/vec2.hpp>
@@ -334,7 +335,7 @@ int test_vec4_equal()
int test_vec4_size()
{
int Error = 0;
Error += sizeof(glm::vec4) == sizeof(glm::lowp_vec4) ? 0 : 1;
Error += sizeof(glm::vec4) == sizeof(glm::mediump_vec4) ? 0 : 1;
Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1;
@@ -345,7 +346,14 @@ int test_vec4_size()
Error += 32 == sizeof(glm::highp_dvec4) ? 0 : 1;
Error += glm::vec4().length() == 4 ? 0 : 1;
Error += glm::dvec4().length() == 4 ? 0 : 1;
struct my_struct
{
glm::uint32 a;
glm::vec4 b;
};
GLM_STATIC_ASSERT(sizeof(my_struct) == sizeof(glm::uint32) + sizeof(glm::vec4), "glm::vec4 alignment is not correct");
return Error;
}