core_func_common.cpp 940 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2011-01-15
  5. // Updated : 2011-01-15
  6. // Licence : This source is under MIT licence
  7. // File : test/gtx/simd-mat4.cpp
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. #include <glm/glm.hpp>
  10. int test_mix()
  11. {
  12. int Error = 0;
  13. {
  14. float A = glm::mix(0.f, 1.f, true);
  15. Error += A == 1.f ? 0 : 1;
  16. float B = glm::mix(0.f, 1.f, false);
  17. Error += B == 0.f ? 0 : 1;
  18. }
  19. {
  20. float A = glm::mix(0.f, 1.f, 1.f);
  21. Error += A == 1.f ? 0 : 1;
  22. float B = glm::mix(0.f, 1.f, 0.f);
  23. Error += B == 0.f ? 0 : 1;
  24. }
  25. return Error;
  26. }
  27. int main()
  28. {
  29. int Error = 0;
  30. Error += test_mix();
  31. return Error;
  32. }