app.h 776 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 <physics/particle.h>
  13. class application
  14. {
  15. private:
  16. uint32_t millisecsPreviousFrame;
  17. bool running;
  18. std::vector<particle *>particles;
  19. public:
  20. application() : running(false) {};
  21. ~application() = default;
  22. void parseParameters(int argc, char *argv[]);
  23. bool isRunning() { return this->running; }
  24. double syncAndDeltatime();
  25. void setup();
  26. void input();
  27. void update();
  28. void render();
  29. void destroy();
  30. };
  31. #endif /* PHYSICENGINE_APP_H */