gtx_gradient_paint.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2011-10-13
  5. // Updated : 2011-10-13
  6. // Licence : This source is under MIT licence
  7. // File : test/gtx/gradient_paint.cpp
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. #include <glm/gtx/gradient_paint.hpp>
  10. int test_radialGradient()
  11. {
  12. int Error = 0;
  13. float Gradient = glm::radialGradient(glm::vec2(0), 1.0f, glm::vec2(1), glm::vec2(0.5));
  14. Error += Gradient != 0.0f ? 0 : 1;
  15. return Error;
  16. }
  17. int test_linearGradient()
  18. {
  19. int Error = 0;
  20. float Gradient = glm::linearGradient(glm::vec2(0), glm::vec2(1), glm::vec2(0.5));
  21. Error += Gradient != 0.0f ? 0 : 1;
  22. return Error;
  23. }
  24. int main()
  25. {
  26. int Error = 0;
  27. Error += test_radialGradient();
  28. Error += test_linearGradient();
  29. return Error;
  30. }