📅  最后修改于: 2022-03-11 14:55:15.592000             🧑  作者: Mango
while (running) {
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
if (msg.message == WM_QUIT) {
running = false;
break;
} else {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
} else {
clock_t last = clock();
deltaTime = last-start;
//if ((double)deltaTime >= 16.666666666) {
fps++;
millis += deltaTime;
start = last;
if (millis > 1000) {
millis = 0;
std::cout << "FPS: " << fps << std::endl;
fps = 0;
}
openglContext.renderScene();
//}
}
}