half_float.cpp 427 B

12345678910111213141516171819202122232425
  1. #include "../precompiled.hpp"
  2. #include <glm/glm.hpp>
  3. #include <glm/gtc/half_float.hpp>
  4. namespace glm{
  5. namespace test
  6. {
  7. bool main_gtc_half_float()
  8. {
  9. bool Result = true;
  10. {
  11. glm::hvec2 A(1.0f, 3.0f);
  12. glm::half B(2.0f);
  13. glm::hvec2 C = A * B;
  14. glm::hvec2 D = C - glm::hvec2(2.0f);
  15. Result = Result && glm::all(glm::equal(C, glm::hvec2(0.0f, 4.0f)));
  16. }
  17. return Result;
  18. }
  19. }//namespace test
  20. }//namespace glm