gtx-simd-vec4.cpp 1.1 KB

123456789101112131415161718192021222324252627282930
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2010-09-16
  5. // Updated : 2010-09-16
  6. // Licence : This source is under MIT licence
  7. // File : test/gtx/simd-vec4.cpp
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. #include <glm/glm.hpp>
  10. #include <glm/gtx/simd_vec4.hpp>
  11. #include <cstdio>
  12. int main()
  13. {
  14. glm::simdVec4 A1(0.0f, 0.1f, 0.2f, 0.3f);
  15. glm::simdVec4 B1(0.4f, 0.5f, 0.6f, 0.7f);
  16. glm::simdVec4 C1 = A1 + B1;
  17. glm::simdVec4 D1 = A1.swizzle<glm::X, glm::Z, glm::Y, glm::W>();
  18. glm::simdVec4 E1(glm::vec4(1.0f));
  19. glm::vec4 F1 = glm::vec4_cast(E1);
  20. //glm::vec4 G1(E1);
  21. //printf("A1(%2.3f, %2.3f, %2.3f, %2.3f)\n", A1.x, A1.y, A1.z, A1.w);
  22. //printf("B1(%2.3f, %2.3f, %2.3f, %2.3f)\n", B1.x, B1.y, B1.z, B1.w);
  23. //printf("C1(%2.3f, %2.3f, %2.3f, %2.3f)\n", C1.x, C1.y, C1.z, C1.w);
  24. //printf("D1(%2.3f, %2.3f, %2.3f, %2.3f)\n", D1.x, D1.y, D1.z, D1.w);
  25. return 0;
  26. }