jumpartifact.com_demo_0/src/game.cc

19 lines
490 B
C++
Raw Normal View History

#include "game.h"
// local includes
#include "screen_test.h"
Game::Game()
: screen_stack(ScreenStack::new_instance()),
prev_time(std::chrono::steady_clock::now()) {}
void Game::update() {
auto next_time = std::chrono::steady_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(
next_time - prev_time);
prev_time = next_time;
screen_stack->update(((float)duration.count()) / 1000000);
2023-07-31 06:28:01 +00:00
}
void Game::draw() { screen_stack->draw(); }