Main.cpp 2.2 KB

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