Answers for "opengl 0 deltatime"

0

opengl 0 deltatime

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();
        //}
    }
}
Posted by: Guest on August-18-2021

Browse Popular Code Answers by Language