gtx_gradient_paint.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2012 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/glm.hpp>
  10. #include <glm/gtx/gradient_paint.hpp>
  11. int test_radialGradient()
  12. {
  13. int Error = 0;
  14. float Gradient = glm::radialGradient(glm::vec2(0), 1.0f, glm::vec2(1), glm::vec2(0.5));
  15. Error += Gradient != 0.0f ? 0 : 1;
  16. return Error;
  17. }
  18. int test_linearGradient()
  19. {
  20. int Error = 0;
  21. float Gradient = glm::linearGradient(glm::vec2(0), glm::vec2(1), glm::vec2(0.5));
  22. Error += Gradient != 0.0f ? 0 : 1;
  23. return Error;
  24. }
  25. int main()
  26. {
  27. int Error = 0;
  28. Error += test_radialGradient();
  29. Error += test_linearGradient();
  30. return Error;
  31. }