|
|
@ -19,8 +19,8 @@ void Window::paintEvent(QPaintEvent *event) { |
|
|
|
game.draw(output); |
|
|
|
game.draw(output); |
|
|
|
label->setPixmap(output.scaled(label->size())); |
|
|
|
label->setPixmap(output.scaled(label->size())); |
|
|
|
update(); |
|
|
|
update(); |
|
|
|
auto now = std::chrono::high_resolution_clock::now(); |
|
|
|
auto now = high_resolution_clock::now(); |
|
|
|
auto diff = duration_cast<std::chrono::nanoseconds>((now - tp)); |
|
|
|
auto diff = duration_cast<nanoseconds>((now - tp)); |
|
|
|
double seconds = double(diff.count()) / 1000. / 1000. / 1000. ; |
|
|
|
double seconds = double(diff.count()) / 1000. / 1000. / 1000. ; |
|
|
|
currentFPS = 1 / seconds; |
|
|
|
currentFPS = 1 / seconds; |
|
|
|
tp = now; |
|
|
|
tp = now; |
|
|
|