Platformer in OpenGL
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
953 B

5 years ago
  1. #include <glm/gtc/matrix_transform.hpp>
  2. #include <glm/gtc/constants.hpp>
  3. int test_perspective()
  4. {
  5. int Error = 0;
  6. glm::mat4 Projection = glm::perspective(glm::pi<float>() * 0.25f, 4.0f / 3.0f, 0.1f, 100.0f);
  7. return Error;
  8. }
  9. int test_pick()
  10. {
  11. int Error = 0;
  12. glm::mat4 Pick = glm::pickMatrix(glm::vec2(1, 2), glm::vec2(3, 4), glm::ivec4(0, 0, 320, 240));
  13. return Error;
  14. }
  15. int test_tweakedInfinitePerspective()
  16. {
  17. int Error = 0;
  18. glm::mat4 ProjectionA = glm::tweakedInfinitePerspective(45.f, 640.f/480.f, 1.0f);
  19. glm::mat4 ProjectionB = glm::tweakedInfinitePerspective(45.f, 640.f/480.f, 1.0f, 0.001f);
  20. return Error;
  21. }
  22. int test_translate()
  23. {
  24. int Error = 0;
  25. glm::lowp_vec3 v(1.0);
  26. glm::lowp_mat4 m(0);
  27. glm::lowp_mat4 t = glm::translate(m, v);
  28. return Error;
  29. }
  30. int main()
  31. {
  32. int Error = 0;
  33. Error += test_translate();
  34. Error += test_tweakedInfinitePerspective();
  35. Error += test_pick();
  36. Error += test_perspective();
  37. return Error;
  38. }