Added initializer list for vectors

master
Christophe Riccio ago%!(EXTRA string=12 years)
parent 9b57315681
commit 26e02fad68
  1. 19
      test/core/core_type_vec2.cpp
  2. 18
      test/core/core_type_vec3.cpp
  3. 8
      test/core/core_type_vec4.cpp

@ -9,6 +9,7 @@
#include <glm/vector_relational.hpp>
#include <glm/vec2.hpp>
#include <vector>
int test_vec2_operators()
{
@ -199,6 +200,24 @@ int test_vec2_ctor()
{
int Error = 0;
#if(GLM_HAS_INITIALIZER_LISTS)
{
glm::vec2 a{ 0, 1 };
std::vector<glm::vec2> v = {
{0, 1},
{4, 5},
{8, 9}};
}
{
glm::dvec2 a{ 0, 1 };
std::vector<glm::dvec2> v = {
{0, 1},
{4, 5},
{8, 9}};
}
#endif
{
glm::vec2 A = glm::vec2(2.0f);
glm::vec2 B = glm::vec2(2.0f, 3.0f);

@ -20,6 +20,24 @@ int test_vec3_ctor()
{
int Error = 0;
#if(GLM_HAS_INITIALIZER_LISTS)
{
glm::vec3 a{ 0, 1, 2 };
std::vector<glm::vec3> v = {
{0, 1, 2},
{4, 5, 6},
{8, 9, 0}};
}
{
glm::dvec3 a{ 0, 1, 2 };
std::vector<glm::dvec3> v = {
{0, 1, 2},
{4, 5, 6},
{8, 9, 0}};
}
#endif
{
glm::vec3 A(1);
glm::vec3 B(1, 1, 1);

@ -49,6 +49,14 @@ int test_vec4_ctor()
{4, 5, 6, 7},
{8, 9, 0, 1}};
}
{
glm::dvec4 a{ 0, 1, 2, 3 };
std::vector<glm::dvec4> v = {
{0, 1, 2, 3},
{4, 5, 6, 7},
{8, 9, 0, 1}};
}
#endif
{

Loading…
Cancel
Save