123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- /*
- * 2D Physic Engine
- * app.h:
- * Based on pikuma.com Learn Game Physics Engine Programming course.
- * Copyright (c) 2022 986-Studio. All rights reserved.
- *
- * Created by Manoël Trapier on 07/06/2022.
- */
- #ifndef PHYSICENGINE_APP_H
- #define PHYSICENGINE_APP_H
- #include <vector>
- #include <SDL.h>
- #include <timeprobe.h>
- #include <physics/particle.h>
- class application
- {
- private:
- uint32_t millisecsPreviousFrame;
- bool running;
- std::vector<particle *>particles;
- timeProbe waitTime, renderTime, updateTime;
- double deltaTime;
- vec2 pushForce = vec2(0, 0);
- vec2 mouseCursor;
- const double G = 0.00000000006674;
- bool leftButtonPressed;
- public:
- application() : running(false), leftButtonPressed(false) {};
- ~application() = default;
- void parseParameters(int argc, char *argv[]);
- bool isRunning() { return this->running; }
- void syncAndDeltatime();
- void setup();
- void input();
- void update();
- void render();
- void destroy();
- };
- #endif /* PHYSICENGINE_APP_H */
|