gtx_functions.cpp 614 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include <glm/gtx/functions.hpp>
  2. #include <vector>
  3. int test_gauss_1d()
  4. {
  5. int Error = 0;
  6. std::vector<float> Result(20);
  7. for(std::size_t i = 0, n = Result.size(); i < n; ++i)
  8. Result[i] = glm::gauss(static_cast<float>(i) * 0.1f, 0.0f, 1.0f);
  9. return Error;
  10. }
  11. int test_gauss_2d()
  12. {
  13. int Error = 0;
  14. std::vector<float> Result(20);
  15. for(std::size_t i = 0, n = Result.size(); i < n; ++i)
  16. Result[i] = glm::gauss(glm::vec2(static_cast<float>(i)) * 0.1f, glm::vec2(0.0f), glm::vec2(1.0f));
  17. return Error;
  18. }
  19. int main()
  20. {
  21. int Error = 0;
  22. Error += test_gauss_1d();
  23. Error += test_gauss_2d();
  24. return Error;
  25. }