core_setup_precision.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2011-05-31
  5. // Updated : 2011-05-31
  6. // Licence : This source is under MIT License
  7. // File : test/core/setup_precision_highp.cpp
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. #define GLM_PRECISION_HIGHP_FLOAT
  10. #include <glm/glm.hpp>
  11. static int test_mat()
  12. {
  13. int Error = 0;
  14. Error += sizeof(glm::mat2) == sizeof(glm::highp_mat2) ? 0 : 1;
  15. Error += sizeof(glm::mat3) == sizeof(glm::highp_mat3) ? 0 : 1;
  16. Error += sizeof(glm::mat4) == sizeof(glm::highp_mat4) ? 0 : 1;
  17. Error += sizeof(glm::mat2x2) == sizeof(glm::highp_mat2x2) ? 0 : 1;
  18. Error += sizeof(glm::mat2x3) == sizeof(glm::highp_mat2x3) ? 0 : 1;
  19. Error += sizeof(glm::mat2x4) == sizeof(glm::highp_mat2x4) ? 0 : 1;
  20. Error += sizeof(glm::mat3x2) == sizeof(glm::highp_mat3x2) ? 0 : 1;
  21. Error += sizeof(glm::mat3x3) == sizeof(glm::highp_mat3x3) ? 0 : 1;
  22. Error += sizeof(glm::mat3x4) == sizeof(glm::highp_mat3x4) ? 0 : 1;
  23. Error += sizeof(glm::mat4x2) == sizeof(glm::highp_mat4x2) ? 0 : 1;
  24. Error += sizeof(glm::mat4x3) == sizeof(glm::highp_mat4x3) ? 0 : 1;
  25. Error += sizeof(glm::mat4x4) == sizeof(glm::highp_mat4x4) ? 0 : 1;
  26. return Error;
  27. }
  28. static int test_vec()
  29. {
  30. int Error = 0;
  31. Error += sizeof(glm::vec2) == sizeof(glm::highp_vec2) ? 0 : 1;
  32. Error += sizeof(glm::vec3) == sizeof(glm::highp_vec3) ? 0 : 1;
  33. Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1;
  34. return Error;
  35. }
  36. int main()
  37. {
  38. int Error = 0;
  39. Error += test_mat();
  40. Error += test_vec();
  41. return Error;
  42. }