File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818static Engine *instance = NULL ;
1919#endif
2020
21+ // TODO: DO WE NEED FIXED UPDATES?
22+ // std::chrono::microseconds FIXED_TIME_STEP(std::chrono::milliseconds(20));
23+
2124Engine::Engine (Game *game)
2225{
2326 log_info (" Initializing SDL" );
@@ -56,6 +59,8 @@ void Engine::start(void)
5659 m_window->makeCurrentContext ();
5760
5861 m_time = std::chrono::high_resolution_clock::now ();
62+ // TODO: DO WE NEED FIXED UPDATES?
63+ // m_physicsTimeSimulated = std::chrono::high_resolution_clock::now();
5964
6065#ifdef EMSCRIPTEN
6166 instance = this ;
@@ -89,6 +94,12 @@ void Engine::tick(void)
8994
9095 m_physicsManager->tick (m_deltaTime);
9196
97+ /* TODO: DO WE NEED FIXED UPDATES?
98+ while (m_physicsTimeSimulated < m_time) {
99+
100+ m_physicsTimeSimulated += FIXED_TIME_STEP;
101+ }*/
102+
92103 game->update (m_window->getInput (), m_deltaTime);
93104
94105 game->render (m_glManager.get ());
Original file line number Diff line number Diff line change 1616#include " Input.h"
1717#include " components/Sphere.h"
1818
19- #define FIXED_TIME_STEP 20
20-
2119class Engine
2220{
2321public:
@@ -46,6 +44,8 @@ class Engine
4644 std::chrono::high_resolution_clock::time_point m_time, m_lastTime;
4745 std::chrono::microseconds m_deltaTime;
4846
47+ // std::chrono::high_resolution_clock::time_point m_physicsTimeSimulated;
48+
4949 Game *game;
5050
5151 Input input;
You can’t perform that action at this time.
0 commit comments