app.h 867 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * 2D Physic Engine
  3. * app.h:
  4. * Based on pikuma.com Learn Game Physics Engine Programming course.
  5. * Copyright (c) 2022 986-Studio. All rights reserved.
  6. *
  7. * Created by Manoël Trapier on 07/06/2022.
  8. */
  9. #ifndef PHYSICENGINE_APP_H
  10. #define PHYSICENGINE_APP_H
  11. #include <vector>
  12. #include <timeprobe.h>
  13. #include <physics/particle.h>
  14. class application
  15. {
  16. private:
  17. uint32_t millisecsPreviousFrame;
  18. bool running;
  19. std::vector<particle *>particles;
  20. timeProbe waitTime, renderTime, updateTime;
  21. double deltaTime;
  22. public:
  23. application() : running(false) {};
  24. ~application() = default;
  25. void parseParameters(int argc, char *argv[]);
  26. bool isRunning() { return this->running; }
  27. void syncAndDeltatime();
  28. void setup();
  29. void input();
  30. void update();
  31. void render();
  32. void destroy();
  33. };
  34. #endif /* PHYSICENGINE_APP_H */