Changeset 046ce72 in opengl-game
- Timestamp:
- Apr 4, 2018, 6:16:44 AM (6 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 1a530df
- Parents:
- e856d62
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
new-game.cpp
re856d62 r046ce72 63 63 SceneObject* clickedObject = NULL; 64 64 SceneObject* selectedObject = NULL; 65 66 double fps; 65 67 66 68 bool faceClicked(ObjectFace* face, vec4 world_ray, vec4 cam, vec4& click_point); … … 408 410 bool cam_moved = false; 409 411 412 int frame_count = 0; 413 double elapsed_seconds_fps = 0.0f, previous_seconds_fps; 414 410 415 double previous_seconds = glfwGetTime(); 416 411 417 while (!glfwWindowShouldClose(window)) { 412 418 double current_seconds = glfwGetTime(); 413 419 double elapsed_seconds = current_seconds - previous_seconds; 414 420 previous_seconds = current_seconds; 421 422 elapsed_seconds_fps += elapsed_seconds; 423 if (elapsed_seconds_fps > 0.25f) { 424 fps = (double)frame_count / elapsed_seconds_fps; 425 cout << "FPS: " << fps << endl; 426 427 frame_count = 0; 428 elapsed_seconds_fps = 0.0f; 429 } 430 431 frame_count++; 415 432 416 433 if (fabs(last_position) > 1.0f) {
Note:
See TracChangeset
for help on using the changeset viewer.