Added mat4 initializer experiment

This commit is contained in:
Christophe Riccio
2013-09-30 00:43:48 +02:00
parent 71855943e0
commit 5dc52c722c
6 changed files with 97 additions and 11 deletions

View File

@@ -10,6 +10,7 @@
#include <glm/core/type_mat4x4.hpp>
#include <glm/gtc/epsilon.hpp>
#include <cstdio>
#include <vector>
void print(glm::dmat4 const & Mat0)
{
@@ -122,10 +123,53 @@ int test_inverse()
return Error;
}
int test_ctr()
{
int Error(0);
#if(GLM_HAS_INITIALIZER_LISTS)
glm::mat4 m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
glm::mat4 m2{
{0, 1, 2, 3},
{4, 5, 6, 7},
{8, 9, 10, 11},
{12, 13, 14, 15}};
std::initializer_list<glm::mat4> m3{
{0, 1, 2, 3},
{4, 5, 6, 7},
{8, 9, 10, 11},
{12, 13, 14, 15}};
glm::mat4 m4{m3};
/*
std::vector<glm::mat4> v{
{
{ 0, 1, 2, 3 },
{ 4, 5, 6, 7 },
{ 8, 9, 10, 11 },
{ 12, 13, 14, 15 }
},
{
{ 0, 1, 2, 3 },
{ 4, 5, 6, 7 },
{ 8, 9, 10, 11 },
{ 12, 13, 14, 15 }
}
};
*/
#endif//GLM_HAS_INITIALIZER_LISTS
return Error;
}
int main()
{
int Error = 0;
Error += test_ctr();
Error += test_inverse_dmat4x4();
Error += test_inverse_mat4x4();
Error += test_operators();

View File

@@ -41,7 +41,13 @@ int test_vec4_ctor()
int Error = 0;
#if(GLM_HAS_INITIALIZER_LISTS)
glm::vec4 v{0, 1, 2, 3};
{
glm::vec4 a{ 0, 1, 2, 3 };
std::vector<glm::vec4> v = {
{0, 1, 2, 3},
{4, 5, 6, 7},
{8, 9, 0, 1}};
}
#endif
{