diff options
Diffstat (limited to 'src/rodeo.c')
| -rw-r--r-- | src/rodeo.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rodeo.c b/src/rodeo.c index c43b9a8..afeefba 100644 --- a/src/rodeo.c +++ b/src/rodeo.c @@ -338,7 +338,19 @@ rodeo_frame_end(void) #endif state.frame_count += 1; state.end_frame = SDL_GetPerformanceCounter(); + +#ifndef __EMSCRIPTEN__ state.frame_time = ((float)(state.end_frame - state.start_frame) * 1000.0f / (float)SDL_GetPerformanceFrequency()); +#else + state.frame_time = (1.0f/60.f) * 1000; //((float)(state.end_frame - state.start_frame) * 1000.0f / (float)SDL_GetPerformanceFrequency()); +#endif + + + /* + float minimum_fps = 20.0f; + float temp_frame_time = ((float)(state.end_frame - state.start_frame) * 1000.0f / (float)SDL_GetPerformanceFrequency()); + state.frame_time = (temp_frame_time < ((1.0f/minimum_fps) * 1000)) ? temp_frame_time : ((1.0f / minimum_fps) * 1000); + */ } void |
