Main.cpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #include "math/Vector.h"
  2. #include "rendering/Framebuffer.h"
  3. #include "rendering/Window.h"
  4. #include "tests/ArrayListTests.h"
  5. #include "tests/ArrayTests.h"
  6. #include "tests/BitArrayTests.h"
  7. #include "tests/BufferTests.h"
  8. #include "tests/ClockTests.h"
  9. #include "tests/ColorTests.h"
  10. #include "tests/ComponentsTests.h"
  11. #include "tests/FrustumTests.h"
  12. #include "tests/HashMapTests.h"
  13. #include "tests/ImageReaderTests.h"
  14. #include "tests/ListTests.h"
  15. #include "tests/MatrixStackTests.h"
  16. #include "tests/MatrixTests.h"
  17. #include "tests/NetworkTests.h"
  18. #include "tests/PlaneTests.h"
  19. #include "tests/QuaternionTests.h"
  20. #include "tests/RandomTests.h"
  21. #include "tests/RingBufferTests.h"
  22. #include "tests/SplitStringTests.h"
  23. #include "tests/StackTests.h"
  24. #include "tests/StringBufferTests.h"
  25. #include "tests/TypedBufferTests.h"
  26. #include "tests/UniquePointerTests.h"
  27. #include "tests/UtilsTests.h"
  28. #include "tests/VectorTests.h"
  29. #include "utils/Logger.h"
  30. #include "wrapper/GL.h"
  31. static int ticks = 40;
  32. static bool isRunning() {
  33. return !Window::shouldClose() && ticks > 0;
  34. }
  35. static void tick() {
  36. ticks -= ticks > 0;
  37. }
  38. static void render(float) {
  39. }
  40. int main(int argAmount, char** args) {
  41. if(argAmount < 2) {
  42. LOG_ERROR("missing path to images");
  43. return 0;
  44. }
  45. ArrayTests::test();
  46. ArrayListTests::test();
  47. HashMapTests::test();
  48. ListTests::test();
  49. BitArrayTests::test();
  50. StringBufferTests::test();
  51. RandomTests::test();
  52. RingBufferTests::test();
  53. SplitStringTests::test();
  54. VectorTests::test();
  55. MatrixTests::test();
  56. StackTests::test();
  57. MatrixStackTests::test();
  58. PlaneTests::test();
  59. FrustumTests::test();
  60. QuaternionTests::test();
  61. UtilsTests::test();
  62. ColorTests::test();
  63. ClockTests::test();
  64. ImageReaderTests::test(args[1]);
  65. BufferTests::test();
  66. TypedBufferTests::test();
  67. UniquePointerTests::test();
  68. NetworkTests::test();
  69. ComponentsTests::test();
  70. Window::Options options(4, 3, {800, 480}, false, "Test");
  71. Error error = Window::open(options);
  72. if(error.has()) {
  73. LOG_ERROR(error.message);
  74. return 0;
  75. }
  76. Window::show();
  77. Window::run<isRunning, tick, render>(50'000'000);
  78. Window::close();
  79. GL::printError("WUSI");
  80. return 0;
  81. }